Saturation And Data Limiting; Data Limiter - Motorola DSP56800 Manual

16-bit digital signal processor
Table of Contents

Advertisement

Data Arithmetic Logic Unit
3.4

Saturation and Data Limiting

DSP algorithms are sometimes capable of calculating values larger than the data precision of the machine
when processing real data streams. Normally, a processor would allow the value to overflow when this
occurred, but this creates problems when processing real-time signals. The solution is saturation, a
technique whereby values that exceed the machine data precision are "clipped," or converted to the
maximum value of the same sign that fits within the given data precision.
Saturation is especially important when data is running through a digital filter whose output goes to a
digital-to-analog converter (DAC), since it "clips" the output data instead of allowing arithmetic overflow.
Without saturation, the output data may incorrectly switch from a large positive number to a large negative
value, which can cause problems for DAC outputs in embedded applications.
The DSP56800 architecture supports optional saturation of results through two limiters found within the
data ALU:
the Data Limiter
the MAC Output Limiter
The Data Limiter saturates values when data is moved out of an accumulator with a MOVE instruction or
parallel move. The MAC Output Limiter saturates the output of the data ALU's MAC unit.
3.4.1

Data Limiter

The data limiter protects against overflow by selectively limiting when reading an accumulator register as
a source operand in a MOVE instruction. When a MOVE instruction specifies an accumulator (F) as a
source, and if the contents of the selected source accumulator can be represented in the destination operand
size without overflow (that is, the accumulator extension register not in use), the data limiter is enabled but
does not saturate, and the register contents are placed onto the CGDB unmodified. If a MOVE instruction
is used and the contents of the selected source accumulator cannot be represented without overflow in the
destination operand size, the data limiter will substitute a "limited" data value onto the CGDB that has
maximum magnitude and the same sign as the source accumulator, as shown in Table 3-4 on page 3-27.
The F0 portion of an accumulator is ignored by the data limiter.
Consider a simple example, shown in Example 3-17.
Example 3-17. Demonstrating the Data Limiter—Positive Saturation
MOVE
#$7FFC,A
INC
A
MOVE
A,X:(R0)+
INC
A
MOVE
A,X:(R0)+
INC
A
MOVE
A,X:(R0)+
INC
A
MOVE
A,X:(R0)+
INC
A
MOVE
A,X:(R0)+
INC
A
MOVE
A,X:(R0)+
MOVE
A1,X:(R0)+
3-26
; Initialize A = $0:7FFC:0000
; A = $0:7FFD:0000
; Write $7FFD to memory (limiter enabled)
; A = $0:7FFE:0000
; Write $7FFE to memory (limiter enabled)
; A = $0:7FFF:0000
; Write $7FFF to memory (limiter enabled)
; A = $0:8000:0000 <=== Overflows 16-bits
; Write $7FFF to memory (limiter saturates)
; A = $0:8001:0000
; Write $7FFF to memory (limiter saturates)
; A = $0:8002:0000
; Write $7FFF to memory (limiter saturates)
; Write $8002 to memory (limiter disabled)
DSP56800 Family Manual

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents