3.3.12.2.1 DSP Multiply Instructions
The DSP instructions that use the multiplier are summarized in Table 3-21.
DSP Instruction(1) |
Description |
Algebraic Equivalent |
---|---|---|
MAC |
Multiply and Add to Accumulator or Square and Add to Accumulator |
a = a + b * c |
MSC |
Multiply and Subtract from Accumulator |
a = a – b * c |
MPY |
Multiply |
a = b * c |
MPYN |
Multiply and Negate Result |
a = -b * c |
SQR | Square to Accumulator |
a = b ^ 2 |
SQRAC | Square and Accumulate |
a = a + (b ^ 2) |
ED |
Partial Euclidean Distance |
a = (b – c)2 |
EDAC |
Add Partial Euclidean Distance to the Accumulator |
a = a + (b – c)2 |
Note:
|
The DSP Multiplier Unsigned/Signed Control (US) bits (CORCON[12]) determine whether the DSP multiply instructions are signed (default) or unsigned. The US bits do not influence the MCU multiply instructions, which have specific instructions for signed or unsigned operation. If the USx bits are set to ‘01’, the input operands for instructions shown in Table 3-21 are considered as unsigned values, which are always zero-extended into the 33rd bit of the multiplier value. If the USx bits are set to ‘00’, the operands are sign-extended.
If the USx bits (CORCON[13:12]) are set to ‘10’, the operands for the instructions listed above are considered as unsigned values. The result is zero-extended prior to any operation with the accumulator (which will always effectively be signed).