
MOTOROLA
11-4
DIGITAL SIGNAL PROCESSING
CPU16
REFERENCE MANUAL
11.5.1 Extension Bit Overflow
Extension bit overflow occurs when successive accumulation causes overflow into
AM[34:31]. Although an overflow has occurred, sign and magnitude are still represent-
ed in 36 bits. Accumulator content cannot be directly converted into a 16-bit fraction,
but it is possible to recover from extension bit overflow during subsequent multiply and
accumulate operations.
A check for overflow into AM[34:31] is performed at the end of MAC, TMER, ACED,
ASLM, and ACE instructions, and after each iteration of the RMAC instruction. When
overflow has occurred, the EV bit in the CPU16 condition code register is set.
Table
11-1
shows the range of AM values and the effects of extension bit overflow. Bit values
are binary.
EV is set when extension bit overflow occurs, but will be cleared when a subsequent
accumulation produces a value within the acceptable range.
Note
The RMAC instruction can be interrupted and restarted. Interrupt ser-
vice routines which include branches based on EV status must be
carefully designed.
11.5.2 Sign Bit Overflow
Sign bit overflow occurs when successive accumulation causes AM35 to be overwrit-
ten. The sign of the number in AM is lost. It is no longer accurately represented in 36
bits and accurate conversion to a 16-bit value is impossible.
A check for overflow into AM35 is performed at the end of MAC, TMER, ACED, ASLM,
and ACE instructions, and after each iteration of the RMAC instruction. When overflow
has occurred, the MV bit in the CPU16 condition code register is set. Since sign bit
overflow can only occur after bits [34:31] have been overwritten, the EV bit must also
be set.
The value of AM35 is latched when MV is set. The latched bit, called the sign latch
(SL), shows the sign of AM immediately after overflow, and is therefore the comple-
ment of the value in AM35 at the time of overflow. SL is stacked by the PSHM instruc-
tion.
Even when a subsequent accumulation produces a value within the acceptable range,
and EV is cleared, MV remains set until cleared by an ANDP, CLRM, TAP, TDP, TEM,
or TEDM instruction. The SL value remains latched until the first sign bit overflow after
MV has been cleared.
Table 11-1 AM Values and Effect on EV
AM Magnitude
1
≤
AM
≤
15.999999999
0
≤
AM
<
1
–1
≤
AM
<
0
–16
≤
AM
<
–1
AM35
0
0
1
1
AM[34:31]
0001
—
1111
0000
1111
0000 —
1110
EV
1
0
0
1
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.