This website uses cookies. By using this site, you consent to the use of cookies. For more information, please take a look at our Privacy Policy.
Home > FPGA Technical Tutorials > Design Recipes for FPGAs Using Verilog and VHDL > Multiplication > Basic Binary Multiplication

TABLE OF CONTENTS

Xilinx FPGA FPGA Forum

Basic Binary Multiplication

FONT SIZE : AAA

The simplest approach to binary multiplication is essentially long multiplication applied to binary numbers. Consider a basic example of a decimal long multiplication first to remind us of the basic concept, take a multiplication of two numbers 23 and 17:

×

2 3

1 7

1 6 1

0 2 3

0 3 9 1

This can be implemented using binary numbers in exactly the same way, except instead of decimal numbers, the arithmetic is binary. Consider the multiplication of two unsigned binary numbers for 6 (0110) and 4 (0100). Simply take each bit of the multiplier (4 in this case) and if it is zero, add nothing, but if the bit is one, add the shifted multiplicand (6 in this case). This is illustrated in the binary multiplication below: 

0110 6

0100 4

0000

0000

0110

0000

0011000 24

Basic signed multiplicationpng

Figure 26.1 Basic signed multiplication.

The way we can often implement this in practice is to have a “partial product” and then add the shifted multiplicand (or zeros) at each stage of the process until the multiplication is complete. While this approach works for unsigned binary numbers, it does not work for two’s complement numbers. In the case of two’s complement, using a similar approach requires the addition of sign bits to the left of the shifted multiplicand at each stage and then a final step of negating the multiplicand and adding the final shifted value to the partial product. A simpler approach that lends itself well to hardware implementation is simply to test whether a number (or both) are negative, invert to obtain the magnitude of each number if necessary, carry out an unsigned multiplication, then, depending on how many of the arguments are negative, invert the output (two’s complement). The method of checking for negative numbers is relatively simple, as an XOR function on the MSB of the two input signed numbers will tag whether the output needs to have a two’s complement taken. This is shown schematically in Figure 26.1. 

  • XC5VLX110-3FF1153C

    Manufacturer:Xilinx

  • FPGA Virtex-5 LX Family 110592 Cells 65nm Technology 1V 1153-Pin FCBGA
  • Product Categories: FPGAs (Field Programmable Gate Array)

    Lifecycle:Active Active

    RoHS: No RoHS

  • XC2V2000-4FGG676C

    Manufacturer:Xilinx

  • FPGA Virtex-II Family 2M Gates 24192 Cells 650MHz 0.15um Technology 1.5V 676-Pin FBGA
  • Product Categories: FPGAs (Field Programmable Gate Array)

    Lifecycle:Obsolete -

    RoHS:

  • XC2V2000-5BGG575I

    Manufacturer:Xilinx

  • FPGA Virtex-II Family 2M Gates 24192 Cells 750MHz 0.15um Technology 1.5V 575-Pin BGA
  • Product Categories: FPGAs (Field Programmable Gate Array)

    Lifecycle:Obsolete -

    RoHS:

  • XC4003E-3VQ100I

    Manufacturer:Xilinx

  • FPGA XC4000E Family 3K Gates 238 Cells 0.35um Technology 5V 100-Pin VTQFP
  • Product Categories: FPGAs (Field Programmable Gate Array)

    Lifecycle:Obsolete -

    RoHS: No RoHS

  • XC5VLX110T-1FFG1136C4031

    Manufacturer:Xilinx

  • Virtex-5 LX FPGA 640 I/O 1136FCBGA
  • Product Categories: FPGAs (Field Programmable Gate Array)

    Lifecycle:Any -

    RoHS:

Need Help?

Support

If you have any questions about the product and related issues, Please contact us.