DATA REPRESENTATION AND ROUNDING
MOTOROLA
DATA ARITHMETIC LOGIC UNIT 3 - 11
7 shows the bit weighting of words, long words, and accumulator operands for this repre-
sentation. The decimal points are all aligned and are left justified.
Data must be converted to a fractional number by scaling before being used by the DSP
or the user will have to be very careful in how the DSP manipulates the data. Moving $3F
to a 24-bit Data ALU register does not result in the contents being $00003F as might be
expected. Assuming numbers are fractional, the DSP left justifies rather than right justi-
fies. As a result, storing $3F in a 24-bit register results in the contents being $3F0000.
The simplest example of scaling is to convert all integer numbers to fractional numbers
by shifting the decimal 24 places to the left (see Figure 3-6). Thus, the data has not
changed; only the position of the decimal has moved.
For words and long words, the most negative number that can be represented is -1
whose internal representation is $800000 and $800000000000, respectively. The most
positive word is $7FFFFF or 1 - 2
-23
and the most positive long word is $7FFFFFFFFFFF
Destination
Memory Reference Source
Operand Accumulator
Sign Limited Value (Hexadecimal) Type of
Access
XDB YDB
XX:A
X:B +
-
7FFFFF
800000
One 24 bit
YY:A
Y:B +
-
7FFFFF
800000 One 24 bit
X and Y
X:A Y:A
X:A Y:B
X:B Y:A
X:B Y:B
L:AB
L:BA
+
-
+
-
+
-
7FFFFF
800000
7FFFFF
800000
7FFFFF
800000
7FFFFF
800000
7FFFFF
800000
7FFFFF
800000
Two 24 bit
L (X:Y) L:A
L:B +
-
7FFFFF
800000 FFFFFF
000000 One 48 bit
Table 3-1 Limited Data Values
S3F.
S.3F
S = SIGN BIT
3F = HEXADECIMAL DATA TO BE CONVERTED
Figure 3-6 Integer-to-Fractional Data Conversion