Fractional Mode And Integer Mode - Analog Devices adsp-2100 Manual

Adsp-2100 family programmable single-chip microprocessors
Table of Contents

Advertisement

C Numeric Formats
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.
General Rule:
(M+P) . (N+Q)
Figure C.3 Format Of Multiplier Result
C.4.1
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
C – 4
4-Bit Example:
M.N
P.Q
11.11
1
1
1
1
1
1
1
1
1
1
1
1
1
.0
0

Fractional Mode And Integer Mode

1.111
1.3 format
2.2 format
1
1
1
1
1
1
0
0
1
3.5 format = (1+2) . (2+3)
16-Bit Examples:
5.3
1.15
5.3
1.15
10.6
2.30

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents