
MPY32 Operation
NOTE:
Changing of first or second operand during multiplication
By default, changing OP1 or OP2 while the selected multiply operation is being calculated
renders any results invalid that are not ready at the time the new operands are changed.
Writing OP2 or OP2L aborts any ongoing calculation and starts a new operation. Results that
are not ready at that time are also invalid for following MAC or MACS operations.
To avoid this behavior, the MPYDLYWRTEN bit can be set to 1. Then, all writes to any
MPY32 registers are delayed with MPYDLY32 = 0 until the 64-bit result is ready or with
MPYDLY32 = 1 until the 32-bit result is ready. For MAC and MACS operations, the complete
64-bit result should always be ready.
See
for how many CPU cycles are needed until a certain result register is ready
and valid for each of the different modes.
14.2.2 Result Registers
The multiplication result is always 64 bits wide. It is accessible via registers RES0 to RES3. Used with a
signed operation, MPYS or MACS, the results are appropriately sign extended. If the result registers are
loaded with initial values before a MACS operation, the user software must take care that the written value
is properly sign extended to 64 bits.
NOTE:
Changing of result registers during multiplication
The result registers must not be modified by the user software after writing the second
operand into OP2 or OP2L until the initiated operation is completed.
In addition to RES0 to RES3, for compatibility with the 16×16 hardware multiplier, the 32-bit result of a 8-
bit or 16-bit operation is accessible via RESLO, RESHI, and SUMEXT. In this case, the result low register
RESLO holds the lower 16 bits of the calculation result and the result high register RESHI holds the upper
16 bits. RES0 and RES1 are identical to RESLO and RESHI, respectively, in usage and access of
calculated results.
The sum extension register SUMEXT contents depend on the multiply operation and are listed in
. If all operands are 16 bits wide or less, the 32-bit result is used to determine sign and carry. If
one of the operands is larger than 16 bits, the 64-bit result is used.
The MPYC bit reflects the multiplier's carry as listed in
and, thus, can be used as 33rd or 65th
bit of the result, if fractional or saturation mode is not selected. With MAC or MACS operations, the MPYC
bit reflects the carry of the 32-bit or 64-bit accumulation and is not taken into account for successive MAC
and MACS operations as the 33rd or 65th bit.
Table 14-4. SUMEXT and MPYC Contents
Mode
SUMEXT
MPYC
MPY
SUMEXT is always 0000h.
MPYC is always 0.
MPYS
SUMEXT contains the extended sign of the result.
MPYC contains the sign of the result.
00000h
Result was positive or zero
0
Result was positive or zero
0FFFFh
Result was negative
1
Result was negative
MAC
SUMEXT contains the carry of the result.
MPYC contains the carry of the result.
0000h
No carry for result
0
No carry for result
0001h
Result has a carry
1
Result has a carry
MACS
SUMEXT contains the extended sign of the result.
MPYC contains the carry of the result.
00000h
Result was positive or zero
0
No carry for result
0FFFFh
Result was negative
1
Result has a carry
414
32-Bit Hardware Multiplier (MPY32)
SLAU272C – May 2011 – Revised November 2013
Copyright © 2011–2013, Texas Instruments Incorporated