dsp56800 Freescale Semiconductor, Inc, dsp56800 Datasheet - Page 70

no-image

dsp56800

Manufacturer Part Number
dsp56800
Description
16-bit Digital Signal Controllers
Manufacturer
Freescale Semiconductor, Inc
Datasheet
Data Arithmetic Logic Unit
3.4
DSC 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 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
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 is 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.
3-26
the Data Limiter
the MAC Output Limiter
MOVE
MOVE
INC
MOVE
INC
MOVE
INC
MOVE
INC
MOVE
INC
MOVE
INC
MOVE
MOVE
Saturation and Data Limiting
Data Limiter
Example 3-17. Demonstrating the Data Limiter — Positive Saturation
#$1000,R0
#$7FFC,A
A
A,X:(R0)+
A
A,X:(R0)+
A
A,X:(R0)+
A
A,X:(R0)+
A
A,X:(R0)+
A
A,X:(R0)+
A1,X:(R0)+
; Store results starting in address $1000
; 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
Freescale Semiconductor

Related parts for dsp56800