XC2200 Derivatives
System Units (Vol. 1 of 2)
Central Processing Unit (CPU)
User’s Manual
4-67
V2.1, 2008-08
CPUSV2_X, V2.2
4.9.7
The Data Limiter
Saturation arithmetic is also provided to selectively limit overflow when reading the
accumulator by means of a
CoSTORE <destination>., MAS
instruction. Limiting is
performed on the MAC-Unit accumulator. If the contents of the accumulator can be
represented in the destination operand size without overflow, then the data limiter is
disabled and the operand is not modified. If the contents of the accumulator cannot be
represented without overflow in the destination operand size, the limiter will substitute a
“limited” data as explained in
Note: In this particular case, both the accumulator and the status register are not
affected. MAS is readable by means of a CoSTORE instruction only.
4.9.8
The Accumulator Shifter
The accumulator shifter is a parallel shifter with a 40-bit input and a 40-bit output. The
source accumulator shifting operations are:
•
No shift (Unmodified)
•
Up to 16-bit Arithmetic Left Shift
•
Up to 16-bit Arithmetic Right Shift
Notice that bits ME, MSV, and MSL in register MSW are affected by left shifts; therefore,
if the saturation mechanism is enabled (MS) the behavior is similar to the one of the
Adder/Subtracter.
Note: Certain precautions are required in case of left shift with saturation enabled.
Generally, if MAE contains significant bits, then the 32-bit value in the accumulator
is to be saturated. However, it is possible that left shift may move some significant
bits out of the accumulator. The 40-bit result will be misinterpreted and will be
either not saturated or saturated incorrectly. There is a chance that the result of
left shift may produce a result which can saturate an original positive number to
the minimum negative value, or vice versa.
Table 4-25
Limiter Output
ME-flag
MN-flag
Output of Limiter
0
x
unchanged
1
0
7FFF
H
1
1
8000
H