dsp56800 Freescale Semiconductor, Inc, dsp56800 Datasheet - Page 62

no-image

dsp56800

Manufacturer Part Number
dsp56800
Description
16-bit Digital Signal Controllers
Manufacturer
Freescale Semiconductor, Inc
Datasheet
Data Arithmetic Logic Unit
3.3.2.3
This format is used when data is being processed as integers. Using this format, the N-bit operand is
represented using the N.0 format (N integer bits). Signed integer numbers lie in the following range:
For words and long-word signed integers the most negative word that can be represented is -32768
($8000), and the most negative long word is -2147483648 ($8000_0000). The most positive word is 32767
($7FFF), and the most positive long word is 2147483647 ($7FFF_FFFF).
3.3.2.4
Unsigned integer numbers may be thought of as positive only. The unsigned numbers have nearly twice
the magnitude of a signed number of the same length. Unsigned integer numbers lie in the following range:
Examples of unsigned integer numbers are 25, 125, and 1999. The binary word is interpreted as having a
binary point immediately to the right of the LSB. The most positive, 16-bit, unsigned integer is 65535
($FFFF). The smallest unsigned number is zero ($0000).
3.3.3
For fractional and integer arithmetic, the operations are performed identically for addition, subtraction, or
comparing two values. This means that any add, subtract, or compare instruction can be used for both
fractional and integer values.
To perform fractional or integer arithmetic operations with word-sized data, the data is loaded into the
MSP (A1 or B1) of the accumulator as shown in Figure 3-9.
Fractional word-sized arithmetic would be performed in a similar manner. For arithmetic operations where
the destination is a 16-bit register or memory location, the fractional or integer operation is correctly
calculated and stored in its 16-bit destination.
3-18
MOVE
MOVE
ADD
MOVE
-2
0 ≤ UI ≤ [2
Addition and Subtraction
Before Execution
[N-1]
Signed Integer
Unsigned Integer
#64,X0
#32,A
X0,A
A1,X:RESULT
X0
$0
A2
≤ SI ≤ [2
N
-1]
$0020
$0040
A1
[N-1]
Figure 3-9. Word-Sized Integer Addition Example
; Load integer value 64 ($40) into X0
; Load integer value 32 ($20) into A Accumulator
; (correctly sign extends into A2 and zeros A0)
; Perform Integer Word Addition
; Save Result (without saturating) to Memory
-1]
$0000
A0
DSP56800 Family Manual
After Execution
X0
$0
A2
$0060
$0040
A1
Freescale Semiconductor
$0000
A0
AA0045

Related parts for dsp56800