Main Content

The Multiplication Process

The multiplication of an n-bit binary number with an m-bit binary number results in a product that is up to m + n bits in length for both signed and unsigned words.

Suppose you want to multiply three numbers. Each of these numbers is represented by a 5-bit word, and each has a different binary-point-only scaling. Additionally, the output is restricted to a 10-bit word with binary-point-only scaling of 2-4. The multiplication is shown in the following model for the input values 5.75, 2.375, and 1.8125.

Applying the rules from the previous section, the multiplication follows these steps:

  1. The first two numbers (5.75 and 2.375) are multiplied:

    QRawProduct=      101.11 ×10.011101.1123   101.1122+101.112101101.10101=13.65625.

    Note that the binary point of the product is given by the sum of the binary points of the multiplied numbers.

  2. The result of step 1 is converted to the output data type:

    QTemp=convert(QRawProduct)=001101.1010=13.6250.

    Signal Conversions discusses conversions. Note that a loss in precision of one bit occurs, with the resulting value of QTemp determined by the rounding mode. For this example, round-to-floor is used. Furthermore, overflow did not occur but is possible for this operation.

  3. The result of step 2 and the third number (1.8125) are multiplied:

    QRawProduct=        01101.1010        ×1.1101 1101.101024       1101.101022  1101.101021+1101.1010200011000.10110010=24.6953125.

    Note that the binary point of the product is given by the sum of the binary points of the multiplied numbers.

  4. The product is converted to the output data type:

    Qa=convert(QRawProduct)=011000.1011=24.6875.

    Signal Conversions discusses conversions. Note that a loss in precision of 4 bits occurred, with the resulting value of QTemp determined by the rounding mode. For this example, round-to-floor is used. Furthermore, overflow did not occur but is possible for this operation.

Blocks that perform multiplication include the Product, Discrete FIR Filter, and Gain blocks.