## 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:

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

$$\begin{array}{c}{Q}_{RawProduct}=\text{1}01.11\\ \text{}\frac{\times \text{\hspace{0.17em}}10.011}{\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{1}01.11\cdot {2}^{-3}}\\ \text{}\frac{\begin{array}{l}\text{1}01.11\cdot {2}^{-2}\\ +\text{\hspace{0.17em}}\text{1}01.11\cdot {2}^{1}\end{array}}{\text{011}01.10101}\begin{array}{c}\\ =\mathrm{13.65625.}\end{array}\end{array}$$

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

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

$$\begin{array}{c}{Q}_{Temp}=convert\left({Q}_{RawProduct}\right)\\ =001101.1010=\mathrm{13.6250.}\end{array}$$

Signal Conversions discusses conversions. Note that a loss in precision of one bit occurs, with the resulting value of

*Q*_{Temp}determined by the rounding mode. For this example, round-to-floor is used. Furthermore, overflow did not occur but is possible for this operation.The result of step 2 and the third number (1.8125) are multiplied:

$$\begin{array}{c}{Q}_{RawProduct}=\text{011}01.1010\\ \text{}\frac{\text{}\times \text{\hspace{0.17em}}1.1101}{\text{\hspace{0.17em}}\text{11}01.1010\cdot {2}^{-4}}\\ \text{}\frac{\begin{array}{l}\text{11}01.1010\cdot {2}^{-2}\\ \text{11}01.1010\cdot {2}^{-1}\\ +\text{\hspace{0.17em}}\text{11}01.1010\cdot {2}^{0}\end{array}}{\text{0011000}.10110010}\begin{array}{c}\\ =\mathrm{24.6953125.}\end{array}\end{array}$$

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

The product is converted to the output data type:

$$\begin{array}{c}{Q}_{a}=convert\left({Q}_{RawProduct}\right)\\ =011000.1011=\mathrm{24.6875.}\end{array}$$

Signal Conversions discusses conversions. Note that a loss in precision of 4 bits occurred, with the resulting value of

*Q*determined by the rounding mode. For this example, round-to-floor is used. Furthermore, overflow did not occur but is possible for this operation._{Temp}

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