Mac Overflow And Saturation - Analog Devices adsp-2100 Manual

Adsp-2100 family programmable single-chip microprocessors
Table of Contents

Advertisement

The 8-bit MR2 register is tied to the lower 8 bits of these buses. When MR2
is output onto the DMD bus or the R bus, it is sign extended to form a 16-
bit value. MR1 also has an automatic sign-extend capability. When MR1 is
loaded from the DMD bus, every bit in MR2 will be set to the sign bit
(MSB) of MR1, so that MR2 appears as an extension of MR1. To load the
MR2 register with a value other than MR1's sign extension, you must load
MR2 after MR1 has been loaded. Loading MR0 affects neither MR1 nor
MR2; no sign extension occurs in MR0 loads.

2.3.2.5 MAC Overflow And Saturation

The adder/subtracter generates an overflow status signal (MV) which is
loaded into the processor arithmetic status (ASTAT) every time a MAC
operation is executed. The MV bit is set when the accumulator result,
interpreted as a twos-complement number, crosses the 32-bit (MR1/MR2)
boundary. That is, MV is set if the upper nine bits of MR are not all ones or
all zeros.
The MR register has a saturation capability which sets MR to the
maximum positive or negative value if an overflow or underflow has
occurred. The saturation operation depends on the overflow status bit
(MV) in the processor arithmetic status (ASTAT) and the MSB of the MR2
register. The following table summarizes the MR saturation operation.
MV
MSB of MR2
0 or 1
0
1
0
1
1
Table 2.3 Effect Of MAC Saturation Instruction
Saturation in the MAC is an instruction rather than a mode as in the ALU.
The saturation instruction is intended to be used at the completion of a
string of multiplication/accumulations so that intermediate overflows do
not cause the accumulator to saturate.
Overflowing beyond the MSB of MR2 should never be allowed. The true
sign bit of the result is then irretrievably lost and saturation may not
produce a correct value. It takes more than 255 overflows (MV type) to
reach this state, however.
Computational Units
MR contents after saturation
no change
00000000 0111111111111111 1111111111111111
11111111 1000000000000000 0000000000000000
2
full-scale positive
full-scale negative
2 – 19

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents