478
CY8C28xxx PSoC Programmable System-on-Chip TRM, Document No. 001-52594 Rev. *G
Multiply Accumulate (MAC)
26.2
Application Description
26.2.1
Multiplication with No
Accumulation
For simple multiplication, the MAC block accepts two 8-bit
signed numbers as the multiplicands for a multiply opera-
tion. The product of the multiplication is stored in a 16-bit
signed form. Up to four registers are involved with simple
multiplication: MULx_X, MULx_Y, MULx_DH, and
MULx_DL.
To execute a multiply, simply write a value to either the
MULx_X or MULx_Y registers. Immediately after the write of
the multiplicand, the product is available at registers
MULx_DH and MULx_DL. After reset of the part at power up
or after an external reset, the MAC registers will not be reset
to zero. Therefore, after the write of the first multiplicand, the
product is indeterminate. After the write of the second multi-
plicand, the product registers are updated with the product
of the first and second multiplicands (assuming one of the
writes was to MULx_X and the other was to MULx_Y). Multi-
plication is associative so the order in which you write to X
and Y does not matter.
26.2.2
Accumulation After Multiplication
Accumulation of products is a feature that is implemented on
top of simple multiplication. When using the MAC to accu-
mulate the products of successive multiplications, two 8-bit
signed values are used for input. The product of the multipli-
cation is accumulated as a 32-bit signed value.
The user has the choice to either cause a multiply/accumu-
late function to take place or a multiply only function. The
user selects which operation is performed by choosing of
input register. The multiply function occurs immediately
whenever the MULx_X or the MULx_Y multiplier input regis-
ters are written, and the result is available in the MULx_DH
and MULx_DL multiplier result registers, as discussed in the
26.2.1 Multiplication with No Accumulation
section. The mul-
tiply/accumulate function is executed whenever there is a
write to the MACx_X or the MACx_Y multiply/accumulate
input registers; the result is available in the ACCx_DR3,
ACCx_DR2, ACCx_DR1, and ACCx_DR0 accumulator
result registers. A write to the MULx_X or MACx_X registers
is input as the X value to both the multiply and multiply/accu-
mulate functions. A write to the MULx_Y or MACx_Y regis-
ters is input as the Y value to both the multiply and multiply/
accumulate functions. A write to the MACx_CL0 or
MACx_CL1 registers will clear the value in the four accumu-
late registers.
To clear the accumulated products, simply write to either of
the MACx_CLx registers.
26.3
Register Definitions
In PSoC devices with more than one MAC block, such as the CY8C28xxx family of devices, there will be one of the following
registers for each block. The registers in this section are listed in address order.
The following registers are associated with the MAC PSoC Blocks. Each register description has an associated register table
showing the bit structure for that register. The ‘X’ in the Access column of some register tables signify that the value after
power on reset is unknown. For a complete table of the MAC registers, refer to the
Summary of Contents for CY8C28 series
Page 65: ...64 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G RAM Paging ...
Page 125: ...124 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G ...
Page 311: ...310 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G IDAC_CR0 1 FDh ...
Page 317: ...316 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G ...
Page 393: ...392 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G ...
Page 477: ...476 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G Digital Clocks ...
Page 561: ...560 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G ...