C Numeric Formats
C – 4
shown in Figure C.3. The product of two 16-bit numbers is a 32-bit
number. If the inputs’ formats are M.N and P.Q, the product has the
format (M+P).(N+Q). For example, the product of two 13.3 numbers is a
26.6 number. The product of two 1.15 numbers is a 2.30 number.
M.N
P.Q
(M+P) . (N+Q)
1.111
11.11
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
.0
1
1
1
0
0
1
1.3 format
2.2 format
3.5 format = (1+2) . (2+3)
General Rule:
4-Bit Example:
16-Bit Examples:
5.3
5.3
10.6
1.15
1.15
2.30
Figure C.3 Format Of Multiplier Result
C.4.1
Fractional Mode And Integer Mode
A product of 2 twos-complement numbers has two sign bits. Since one of
these bits is redundant, you can shift the entire result left one bit.
Additionally, if one of the inputs was a 1.15 number, the left shift causes
the result to have the same format as the other input (with 16 bits of
additional precision). For example, multiplying a 1.15 number by a 5.11
number yields a 6.26 number. When shifted left one bit, the result is a 5.27
number, or a 5.11 number plus 16 LSBs.
The ADSP-2100 family provides a mode (called the fractional mode) in
which the multiplier result is always shifted left one bit before being
written to the result register. (On the ADSP-2100 processor, this mode is
always active; on other processors, the left shift can be omitted.) This left
shift eliminates the extra sign bit when both operands are signed, yielding
a correctly formatted result.
When both operands are in 1.15 format, the result is 2.30 (30 fractional
bits). A left shift causes the multiplier result to be 1.31 which can be
rounded to 1.15. Thus, if you use a fractional data format, it is most
convenient to use the 1.15 format.
In the integer mode, the left shift does not occur. This is the mode to use if
both operands are integers (in the 16.0 format). The 32-bit multiplier result
is in 32.0 format, also an integer. On the ADSP-2100 only, the integer mode