MPY32 Operation
274
SLAU367P – October 2012 – Revised April 2020
Copyright © 2012–2020, Texas Instruments Incorporated
32-Bit Hardware Multiplier (MPY32)
5.2.1 Operand Registers
Operand one (OP1) has 12 registers (see
) used to load data into the multiplier and also select
the multiply mode. Writing the low word of the first operand to a given address selects the type of multiply
operation to be performed, but does not start any operation. When writing a second word to a high-word
register with suffix 32H, the multiplier assumes a 32-bit-wide OP1, otherwise, 16 bits are assumed. The
last address written prior to writing OP2 defines the width of the first operand. For example, if MPY32L is
written first followed by MPY32H, all 32 bits are used and the data width of OP1 is set to 32 bits. If
MPY32H is written first followed by MPY32L, the multiplication ignores MPY32H and assumes a 16-bit-
wide OP1 using the data written into MPY32L.
Repeated multiply operations may be performed without reloading OP1 if the OP1 value is used for
successive operations. It is not necessary to rewrite the OP1 value to perform the operations.
Table 5-2. OP1 Registers
OP1 Register
Operation
MPY
Unsigned multiply – operand bits 0 up to 15
MPYS
Signed multiply – operand bits 0 up to 15
MAC
Unsigned multiply accumulate –operand bits 0 up to 15
MACS
Signed multiply accumulate – operand bits 0 up to 15
MPY32L
Unsigned multiply – operand bits 0 up to 15
MPY32H
Unsigned multiply – operand bits 16 up to 31
MPYS32L
Signed multiply – operand bits 0 up to 15
MPYS32H
Signed multiply – operand bits 16 up to 31
MAC32L
Unsigned multiply accumulate – operand bits 0 up to 15
MAC32H
Unsigned multiply accumulate – operand bits 16 up to 31
MACS32L
Signed multiply accumulate – operand bits 0 up to 15
MACS32H
Signed multiply accumulate – operand bits 16 up to 31
Writing the second operand to the OP2 initiates the multiply operation. Writing OP2 starts the selected
operation with a 16-bit-wide second operand together with the values stored in OP1. Writing OP2L starts
the selected operation with a 32-bit-wide second operand and the multiplier expects a the high word to be
written to OP2H. Writing to OP2H without a preceding write to OP2L is ignored.
Table 5-3. OP2 Registers
OP2 Register
Operation
OP2
Start multiplication with 16-bit-wide OP2 – operand bits 0 up to 15
OP2L
Start multiplication with 32-bit-wide OP2 – operand bits 0 up to 15
OP2H
Continue multiplication with 32-bit-wide OP2 – operand bits 16 up to 31
For 8-bit or 24-bit operands, the operand registers can be accessed with byte instructions. Accessing the
multiplier with a byte instruction during a signed operation automatically causes a sign extension of the
byte within the multiplier module. For 24-bit operands, only the high word should be written as byte. If the
24-bit operands are sign-extended as defined by the register, that is used to write the low word to,
because this register defines if the operation is unsigned or signed.
The high-word of a 32-bit operand remains unchanged when changing the size of the operand to 16 bit,
either by modifying the operand size bits or by writing to the respective operand register. During the
execution of the 16-bit operation, the content of the high-word is ignored.