MOTOROLA
11-2
DIGITAL SIGNAL PROCESSING
CPU16
REFERENCE MANUAL
Figure 11-1 MAC Unit Register Model
11.3 Modulo Addressing
The MAC unit uses a simplified form of modulo addressing to implement finite impulse
response filters and circular buffers during execution of MAC and RMAC instructions.
It is accomplished by means of address masks.
During execution of MAC and RMAC, an offset is added to the content of IX and IY to
compute the effective address of data accesses. XMSK and YMSK are used to deter-
mine which bits change when an offset is added.
Each address mask consists of eight bits. Each bit in the mask corresponds to a bit in
the low byte of an index register. When a mask bit is set, the corresponding index reg-
ister bit is changed by addition of the offset. This permits modulo addressing on any
power of two boundary from 2
1
to 2
8
. The possible buffer sizes are 2, 4, 8, 16, 32, 64,
128, and 256 bytes.
To enable a buffer, set the mask bits corresponding to a particular power of two. All
set bits must be right-justified within the mask. For example, a mask value of
$00011111 (2
5
) enables a 32-byte buffer, while a mask value of $00001111 (2
4
) en-
ables a 16-byte buffer. If all set bits in the mask are not right-justified, results of the
masking operation are undefined. Clear the masks to disable modulo addressing.
Modulo addressing cannot cross bank boundaries. Buffers must be within the bank
specified by the current index register extension field (XK or YK).
11.4 MAC Data Types
Multiplicand and multiplier operands are 16-bit fractions. Bit 15 is the sign bit. An im-
plied radix point lies between bits 15 and 14. There are 15 bits of magnitude. The
range of values is –1 ($8000) to 1 – 2
-15
($7FFF).
The product of a MAC multiplication is a 32-bit signed fraction. Bit 31 is the sign bit. An
implied radix point lies between bits 31 and 30. There are 31 bits of magnitude, but bit
0 is always cleared. The range of values is –1 ($80000000) to 1 – 2
-30
($7FFFFFFE).
20
16 15
8 7
0 Bit Position
HR
MAC Multiplier Register
IR
MAC Multiplicand Register
AM
AM
MAC Accumulator MSB [35:16]
MAC Accumulator LSB [15:0]
XMSK
YMSK
MAC XY Mask Register
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.