dsp56800e Freescale Semiconductor, Inc, dsp56800e Datasheet - Page 188

no-image

dsp56800e

Manufacturer Part Number
dsp56800e
Description
16-bit Digital Signal Controller Core
Manufacturer
Freescale Semiconductor, Inc
Datasheet
Data Arithmetic Logic Unit
Once the accumulator increments to $7FFF in Example 5-31, the saturation logic in the MAC output
limiter prevents it from growing larger because it can no longer fit into a 16-bit memory location without
overflow. So, an overflowed value is not written to back to the A accumulator; the value of the most
positive 32-bit number, $7FFF:FFFF, is written instead.
The saturation logic operates by checking 3 bits of the 36-bit result out of the MAC unit—EXT[3],
EXT[0], and MSP[15]. As shown in Table 5-4, when the SA bit is set, these 3 bits determine whether
saturation is performed on the MAC unit’s output and whether to saturate to the maximum positive value
($7FFF:FFFF) or to the maximum negative value ($8000:0000).
The MAC output limiter affects not only the results calculated by the instruction, but condition code
computation as well. See Section B.1.2, “MAC Output Limiter,” on page B-3 for more information.
5.8.3
The MAC output limiter is always disabled (even if the SA bit is set) when the following instructions are
executed:
5-42
ASLL.W, ASRR.W, LSRR.W
ASL16, ASR16, LSR16, ASRAC,
LSRAC
IMAC.L, IMPY.L, IMPY.W
Instructions Not Affected by the MAC Output Limiter
BFSET
MOVE.W
NOP
INC.W
INC.W
INC.W
INC.W
INC.W
ADD.W
EXT[3]
0
0
0
0
1
1
1
1
Example 5-31. Demonstrating the MAC Output Limiter
Table 5-4. MAC Unit Outputs with Saturation Enabled
#$0010,OMR
#$7FFC,A
A
A
A
A
A
#9,A
EXT[0]
0
0
1
1
0
0
1
1
DSP56800E Core Reference Manual
; 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!
MSP[15]
0
1
0
1
0
1
0
1
Result as calculated, with no limiting
$0:7FFF:FFFF
$0:7FFF:FFFF
$0:7FFF:FFFF
$F:8000:0000
$F:8000:0000
$F:8000:0000
Result as calculated, with no limiting
Result Stored in Accumulator
ASLL.L, ASRR.L, LSRR.L
IMPYSU, IMACUS, IMPYUU,
IMACUU
MPYSU, MACSU
Freescale Semiconductor

Related parts for dsp56800e