ST10R272L - MULTIPLY-ACCUMULATE UNIT (MAC)
76/320
5.2.10 Number representation & rounding
The MAC supports the two’s-complement representation of binary numbers. In this format,
the sign bit is the MSB of the binary word. This is set to zero for positive numbers and set to
one for negative numbers. Unsigned numbers are supported only by multiply/
multiply-accumulate instructions which specifies whether each operand is signed or
unsigned.
In two’s complement fractional format, the N-bit operand is represented using the 1.[N-1]
format (1 signed bit, N-1 fractional bits). Such a format can represent numbers between -1
and +1-2
-[N-1]
. This format is supported when MP of MCW is set.
The MAC implements ‘two’s complement rounding’. With this rounding type, one is added to
the bit to the right of the rounding point (bit 15 of MAL), before truncation (MAL is cleared).