![Infineon Technologies XC2200 User Manual Download Page 209](http://html1.mh-extra.com/html/infineon-technologies/xc2200/xc2200_user-manual_2055439209.webp)
XC2200 Derivatives
System Units (Vol. 1 of 2)
Central Processing Unit (CPU)
User’s Manual
4-71
V2.1, 2008-08
CPUSV2_X, V2.2
MAC Unit Status (MV, MN, MZ, MC, MSV, ME, MSL)
These condition flags indicate the MAC status resulting from the most recently
performed MAC operation. These flags are controlled by the majority of MAC instructions
according to specific rules. Those rules depend on the instruction managing the MAC or
data movement operation.
After execution of an instruction which explicitly updates register MSW, the condition
flags may no longer represent an actual MAC status. An explicit write operation to
register MSW supersedes the condition flag values implicitly generated by the MAC unit.
An explicit read access returns the value of register MSW after execution of the
immediately preceding instruction. Register MSW can be accessed via any instruction
capable of accessing an SFR.
Note: After reset, all MAC status bits are cleared.
MN-Flag:
For the majority of the MAC operations, the MN-flag is set to 1 if the most
significant bit of the result contains a 1; otherwise, it is cleared. In the case of integer
operations, the MN-flag can be interpreted as the sign bit of the result (negative: MN = 1,
positive: MN = 0). Negative numbers are always represented as the 2’s complement of
the corresponding positive number. The range of signed numbers extends from
80’0000’0000
H
to 7F’FFFF’FFFF
H
.
MZ-Flag:
The MZ-flag is normally set to 1 if the result of a MAC operation equals zero;
otherwise, it is cleared.
MC-Flag:
After a MAC addition, the MC-flag indicates that a “Carry” from the most
significant bit of the accumulator extension MAE has been generated. After a MAC
subtraction or a MAC comparison, the MC-flag indicates a “Borrow” representing the
logical negation of a “Carry” for the addition. This means that the MC-flag is set to 1 if
no
“Carry” from the most significant bit of the accumulator has been generated during a
subtraction. Subtraction is performed by the MAC Unit as a 2’s complement addition and
the MC-flag is cleared when this complement addition caused a “Carry”.
For left-shift MAC operations, the MC-flag represents the value of the bit shifted out last.
Right-shift MAC operations always clear the MC-flag. The arithmetic right-shift MAC
operation can set the MC-flag if the enabled round operation generates a “Carry” from
the most significant bit of the accumulator extension MAE.
MSV-Flag:
The addition, subtraction, 2’s complement, and round operations always set
the MSV-flag to 1 if the MAC result exceeds the maximum range of 40-bit signed
numbers. If the MSV-flag indicates an arithmetic overflow, the MAC result of an
operation is not valid.
The MSV-flag is a ‘Sticky Bit’. Once set, other MAC operations cannot affect the status
of the MSV-flag. Only a direct write operation can clear the MSV-flag.
ME-Flag:
The ME-flag is set if the accumulator extension MAE contains significant bits,
that means if the nine highest accumulator bits are not all equal.