Integer/Fractional Number Comparison - Motorola DSP56000 Manual

24-bit digital signal processor
Hide thumbs Also See for DSP56000:
Table of Contents

Advertisement

A1 or B1(see Figure 3-8).
TWOS COMPLEMENT INTEGER
TWOS COMPLEMENT FRACTIONAL
FRACTIONAL = INTEGER EXCEPT FOR X AND
Figure 3-8 Integer/Fractional Number Comparison
A comparison between integer and fractional number representation is shown in Figure
3-8 . The number representation for integers is between ± 2
representation is limited to numbers between ± 1. To convert from an integer to a frac-
tional number, the integer must be multiplied by a scaling factor so the result will always
be between ± 1. The representation of integer and fractional numbers is the same if the
numbers are added or subtracted but is different if the numbers are multiplied or divided.
An example of two numbers multiplied together is given in Figure 3-9. The key difference
is that the extra bit in the integer multiplication is used as a duplicate sign bit and as the
least significant bit (LSB) in the fractional multiplication. The advantages of fractional
data representation are as follows:
The MSP (left half) has the same format as the input data.
The LSP (right half) can be rounded into the MSP without shifting or updating the
exponent.
A significant bit is not lost through sign extension.
Conversion to floating-point representation is easier because the industry-standard
floating-point formats use fractional mantissas.
Coefficients for most digital filters are derived as fractions by the high-level language
programs used in digital-filter design packages, which implies that the results can be
used without the extensive data conversions that other formats require.
Should integer arithmetic be required in an application, shifting a one or zero, depending
on the sign, into the MSB converts a fraction to an integer.
The Data ALU MAC performs rounding of the accumulator register to single precision if
requested in the instruction (the A1 or B1 register is rounded according to the contents of
the A0 or B0 register). The rounding method is called round-to-nearest (even) number, or
convergent rounding. The usual rounding method rounds up any value above one-half
MOTOROLA
DATA REPRESENTATION AND ROUNDING
÷
DATA ARITHMETIC LOGIC UNIT
N BITS
S
S
N BITS
(N-1)
; whereas, the fractional
[
]
(N–1)
(N–1)
–2
TO
+2
–1
[
]
–(N–1)
–1 TO
+1–2
3 - 13

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dsp56k

Table of Contents