dsp56800e Freescale Semiconductor, Inc, dsp56800e Datasheet - Page 187

no-image

dsp56800e

Manufacturer Part Number
dsp56800e
Description
16-bit Digital Signal Controller Core
Manufacturer
Freescale Semiconductor, Inc
Datasheet
Once the accumulator increments to $8000 in Example 5-29, the positive result can no longer be written to
a 16-bit memory location without overflow. So, instead of writing an overflowed value to memory, the
data limiter writes $7FFF, the maximum positive value that can be represented by a signed, 16-bit word.
Note that the data limiter affects only the value written to memory; it does not affect the accumulator. In
the final instruction of the example, the limiter is disabled because the register is specified as A1.
Example 5-30 is a simple illustration of negative saturation.
Once the accumulator decrements to $7FFF in Example 5-30, the negative result can no longer fit into a
16-bit memory location without overflow. So, instead of writing an overflowed value to memory, the data
limiter writes the most negative 16-bit number, $8000. Limiting is bypassed when individual portions of
the accumulator, rather than the entire accumulator, are read (as in the last line of the example).
5.8.2
The MAC output limiter optionally saturates or limits results that are calculated by data ALU arithmetic
operations such as multiplication, addition, incrementing, rounding, and so on.
The MAC output limiter can be enabled by setting the SA bit in the operating mode register (see
Section 8.2.1.3, “Saturation (SA)—Bit 4,” on page 8-6). It is also used when the SAT instruction is
executed, which saturates the value of the source accumulator and stores the result in a data ALU register.
Consider the simple example in Example 5-31 on page 5-42.
Freescale Semiconductor
MAC Output Limiter
MOVE.W
DEC.W
MOVE.W
DEC.W
MOVE.W
DEC.W
MOVE.W
DEC.W
MOVE.W
DEC.W
MOVE.W
DEC.W
MOVE.W
MOVE.W
Example 5-30. Demonstrating the Data Limiter—Negative Saturation
When the SA bit in the OMR is modified, a delay of 2 instruction cycles is
necessary before the new saturation mode becomes active.
#$8003,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)+
Data Arithmetic Logic Unit
; Initialize A = $F:8003:0000
; A = $F:8002:0000
; Write $8002 to memory (limiter enabled)
; A = $F:8001:0000
; Write $8001 to memory (limiter enabled)
; A = $F:8000:0000
; Write $8000 to memory (limiter enabled)
; A = $F:7FFF:0000 <=== Overflows 16 bits!
; Write $8000 to memory (limiter saturates)
; A = $F:7FFE:0000
; Write $8000 to memory (limiter saturates)
; A = $F:7FFD:0000
; Write $8000 to memory (limiter saturates)
; Write $7FFD to memory (limiter disabled)
NOTE:
Saturation and Data Limiting
5-41

Related parts for dsp56800e