EasyManua.ls Logo

ST ST10F276E - Data Limiter; Table 12. Limiter Output Using Costore Instruction; The 40-Bit Adder; Subtracter

ST ST10F276E
564 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Multiply-accumulate unit (MAC) UM0404
88/564 DocID13284 Rev 2
POP MAL
POP MSW
4.2.7 The 40-bit adder / subtracter
The 40-bit Adder/Subtracter allows intermediate overflows in a series of multiply/accumulate
operations. The Adder/Subtracter has two input ports. One input is the feedback of the 40-
bit Signed Accumulator output through the ACCU-Shifter. The second input is the 32-bit
operand coming from the One-bit Scaler. The 32-bit operands are sign-extended to 40-bit
before the addition/subtraction is performed.
The output of the Adder/Subtracter goes to the 40-bit Signed Accumulator. It is also possible
to round and to saturate the result to 32-bit automatically after every accumulation before to
be loaded into the accumulator. The round operation is performed by adding 00’0000’8000h
to the result. Automatic saturation is enabled by setting the MCW.MS saturation bit.
When the 40-bit Signed Accumulator is in the overflow saturation mode and an overflow
occurs, the accumulator is loaded with either the most positive or the most negative possible
32-bit value, depending on the direction of the overflow as well as the arithmetic used. The
value of the accumulator upon saturation is 00’7FFF’FFFFh (positive) or FF’8000’0000h
(negative).
4.2.8 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 Accumulator. If the contents of the Accumulator can be represented
in the destination operand size without overflow, 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 the
following table.
Note: 1 When data limiter is disabled, a reading with ‘CoSTORE <destination>, <MAH> instruction
or ‘CoSTORE <destination>, <MAS> instruction’ gives the same result
2 If data limiter is activated, a read with ‘CoSTORE <destination>, <MAH> instruction’ or
‘CoSTORE <destination>, <MAS> instruction’ gives different results. MAS gives the
saturated value of MAH. The reading of MAL and MSW (MAE) are not saturated.
Table 12. Limiter output using CoSTORE instruction
ME-flag MN-flag MAS value (saturated MAH value)
3
0 x Unchanged
1
1 0 7FFFh
2
1 1 8000h
2

Table of Contents

Related product manuals