dsp56800 Freescale Semiconductor, Inc, dsp56800 Datasheet - Page 72

no-image

dsp56800

Manufacturer Part Number
dsp56800
Description
16-bit Digital Signal Controllers
Manufacturer
Freescale Semiconductor, Inc
Datasheet
Data Arithmetic Logic Unit
This is clearly in error because the value -1.0 in the X0 register greatly differs from the value of +1.0 in the
source accumulator. In this case, overflow has occurred. To minimize the error due to overflow, it is
preferable to write the maximum (“limited”) value the destination can assume. In this example, the limited
value would be:
This is clearly closer to the original value, +1.0, than -1.0 is, and thus introduces less error. Saturation is
equally applicable to both integer and fractional arithmetic.
Thus, saturation arithmetic can have a large effect in moving from register A1 to register X0. The
instruction MOVE A1,X0 performs a move without limiting, and the instruction MOVE A,X0 performs a
move of the same 16 bits with limiting enabled. The magnitude of the error without limiting is 2.0; with
limiting it is 0.000031.
3.4.2
The MAC output limiter optionally saturates or limits results calculated by data ALU arithmetic operations
such as multiply, add, increment, round, and so on.
The MAC Output Limiter can be enabled by setting the SA bit in the OMR register. See Section 5.1.9.3,
“Saturation (SA) — Bit 4,” on page 5-11.
Consider a simple example, shown in Example 3-19.
3-28
35
3
0 . . . 0 1 0 0 . . . . . . . . . . 0 0 0 0 . . . . . . . . . . . 0 0
*Limiting automatically occurs when the 36-bit operands A and B are read with a MOVE instruction. Note that the
contents of the original accumulator are not changed.
0 15
0.111 1111 1111 1111 (+ 0.999969 fractional decimal, $7FFF in hexadecimal)
BFSET #$0010,OMR
MOVE
NOP
INC
INC
INC
INC
INC
ADD
15
MAC Output Limiter
1 0 0 . . . . . . . . . . 0 0
Without Limiting — MOVE A1,X0
#$7FFC,A
A
A
A
A
A
#9,A
Example 3-19. Demonstrating the MAC Output Limiter
0 15
0
X0 = -1.0
Figure 3-14. Example of Saturation Arithmetic
; Set SA bit —- enables MAC Output Limiter
; Initialize A = $0_7FFC_0000
; A = $0_7FFD_0000
; A = $0_7FFE_0000
; A = $0_7FFF_0000
; A = $0_7FFF_FFFF <=== Saturates to 16-bits!
; A = $0_7FFF_FFFF <=== Saturates to 16-bits!
; A = $0_7FFF_FFFF <=== Saturates to 16-bits!
IERRORI = 2.0
DSP56800 Family Manual
0
0
A = +1.0
35
3
0 . . . 0 1 0 0 . . . . . . . . . . 0 0 0 0 . . . . . . . . . . . 0 0
0 15
15
0 1 1 . . . . . . . . . . 1 1
With Limiting — MOVE A,X0
0 15
0
X0 = +0.999969
Freescale Semiconductor
IERRORI =.000031
0
0
A = +1.0

Related parts for dsp56800