Fixed-Point Blockset | ![]() ![]() |
Multiplication
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. Most processors perform n-bit by n-bit multiplication and produce a 2n-bit result (double bits) assuming there is no overflow condition.
For example, the Texas Instruments TMS320C2x family of processors performs two's complement 16-bit by 16-bit multiplication and produces a 32-bit (double bit) result.
Fixed-Point Blockset Multiplication Process
Consider the multiplication of two numbers. Ideally, the real-world values obey the equation
where Vb and Vc are the input values and Va is the output value. To see how the multiplication is actually implemented, the three ideal values should be replaced by the general [Slope Bias] encoding scheme described in Scaling:
The solution of the resulting equation for the output stored integer, Qa, is given below:
The worst-case implementation of this equation occurs when the slopes and biases of the input and output signals are mismatched. This worst-case implementation is permitted in simulation but is not always permitted for code generation since it often requires more resources than is considered practical for an embedded system. For code generation and bit-true simulations, the biases must be zero and the fractional slopes must match for most blocks. When these requirements are met, the implementation reduces to
The bit-true implementation of this equation is discussed below.
Offline Conversions. As shown in the previous section, no offline conversions are performed.
Online Conversions and Operations. The online conversions and operations for matched slopes and biases of zero are given by these steps:
Example: The Multiplication Process
Suppose you want to multiply three numbers. Each of these numbers is represented by a 5-bit word, and each has a different radix point-only scaling. Additionally, the output is restricted to a 10-bit word with radix point-only scaling of 2-4. The multiplication is shown below for the input values 5.75, 2.375, and 1.8125.
Applying the rules from the previous section, the multiplication follows these steps:
Blocks that perform multiplication include the Product, FIR, Gain, and Matrix Gain blocks.
![]() | Addition and Subtraction | Division | ![]() |