Mac Output Limiter; Figure 3-14 Example Of Saturation Arithmetic - Motorola DSP56800 Manual

16-bit digital signal processor
Table of Contents

Advertisement

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:
0.111 1111 1111 1111(+ 0.999969 fractional decimal, $7FFF in hexadecimal)
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.
Without Limiting—MOVE A1,X0
35
0 . . . 0 1 0 0 . . . . . . . . . . 0 0 0 0 . . . . . . . . . . . 0 0
3
0 15
1 0 0 . . . . . . . . . . 0 0
15
*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.
3.4.2

MAC Output Limiter

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.
Example 3-19. Demonstrating the MAC Output Limiter
BFSET #$0010,OMR
MOVE
#$7FFC,A
NOP
INC
A
INC
A
INC
A
INC
A
INC
A
ADD
#9,A
3-28
0
A = +1.0
0 15
0
X0 = -1.0
0
IERRORI = 2.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!
DSP56800 Family Manual
With Limiting—MOVE A,X0
35
0 . . . 0 1 0 0 . . . . . . . . . . 0 0 0 0 . . . . . . . . . . . 0 0
3
0 15
0 15
0 1 1 . . . . . . . . . . 1 1
15
0
0
A = +1.0
0
X0 = +0.999969
IERRORI = .000031

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents