
MOTOROLA
6-154
INSTRUCTION GLOSSARY
CPU16
REFERENCE MANUAL
MAC
Operation:
Multiply and Accumulate
MAC
(HR)
(IR)
E : D
(AM)
+
(E : D)
AM
((IX)
≤
X MASK)
((IX)
+
xo)
≤
X MASK)
IX
((IY)
≤
Y MASK)
((IY)
+
yo)
≤
Y MASK)
IY
(HR)
IZ
(M : M
+
1)
X
HR
(M : M
+
1)
Y
IR
Description:
Multiplies a 16-bit signed fractional multiplicand in MAC register I by
a 16-bit signed fractional multiplier in MAC register H. There are im-
plied radix points between bits 15 and 14 of the registers. The prod-
uct is left-shifted one place to align the radix point between bits 31
and 30, then placed in bits 31:1 of concatenated accumulators E
and D. D0 is cleared. The aligned product is then added to the con-
tent of AM.
As multiply and accumulate operations take place, 4-bit offsets xo
and yo are sign-extended to 16 bits and used with X and Y masks to
qualify the X and Y index registers.
Writing a non-zero value into a mask register prior to MAC execution
enables modulo addressing. The TDMSK instruction writes mask
values. When a mask contains $0, modulo addressing is disabled,
and the sign-extended offset is added to the content of the corre-
sponding index register.
After accumulation, the content of HR is transferred to IZ, then a
word at the address pointed to by XK : IX is loaded into HR, and a
word at the address pointed to by YK : IY is loaded into IR. The frac-
tional product remains in concatenated E and D.
When both registers contain $8000 (–1), a value of $80000000 (1.0
in 36-bit format) is accumulated, (E
:
D) is $80000000 (–1 in 32-bit
format), and the V bit in the condition code register is set. See
SEC-
TION 11 DIGITAL SIGNAL PROCESSING
for more information.
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.