MOTOROLA
11-8
DIGITAL SIGNAL PROCESSING
CPU16
REFERENCE MANUAL
As multiply and accumulate operations take place, 4-bit offsets (xo, yo) specified by
an instruction operand are sign-extended to 16 bits and used with XMSK and YMSK
to qualify the corresponding index registers. The following expressions are used to
qualify the index registers:
IX
=
((IX)
X MASK)
((IX)
+
xo)
X MASK)
IY
=
((IY)
Y MASK)
((IY)
+
yo)
Y MASK)
Writing a non-zero value into a mask register prior to RMAC execution enables modulo
addressing. The TDMSK instruction writes mask values. When a mask contains $0,
the sign-extended offset is added to the content of the corresponding index register.
After accumulation, a word pointed to by XK: IX is loaded into HR, and a word pointed
to by YK: IY is loaded into IR, then the value in E is decremented and tested. If these
values are to be used in successive RMAC operations, the registers must be re-initial-
ized with the LDHI instruction. RMAC always iterates at least once, even when exe-
cuted with a zero or negative value in E. Since the value in E is decremented, then
tested, loading E with $8000 results in 32,770 iterations.
If HR and IR both contain $8000 (–1), a value of $80000000 (1.0 in 36-bit format) is
accumulated, but no condition code is set.
RMAC execution is suspended during bus error, breakpoint, and interrupt exceptions.
Operation resumes when RTI is executed at the end of the exception handler. In order
for execution to resume correctly, all registers used by RMAC must be stacked or left
unchanged by the exception handler. The PSHMAC and PULMAC instructions stack
MAC unit resources. See
SECTION 9 EXCEPTION PROCESSING
for more informa-
tion.
11.7.3.3 FMULS — Signed Fractional Multiply
FMULS left-shifts the product of a 16-bit signed fractional multiplication once before
placing it in concatenated accumulators E and D.
A 16-bit signed fractional multiplicand contained by accumulator E is multiplied by a
16-bit signed fractional multiplier contained by accumulator D. There are implied radix
points between bits 15 and 14 of the accumulators. The product is left-shifted one
place to align the radix point between bits 31 and 30, then placed in E : D[31
:
1]. D0 is
cleared.
When both accumulators contain $8000 (–1), the product is $80000000 (–1.0) and the
CCR V bit is set.
11.7.3.4 ACED — Add E: D to AM
ACED is used with either of the FMULS or MAC instructions. It allows direct addition
of 32-bit signed fractions to accumulator M. The concatenated contents of accumula-
tors E and D are added to the content of accumulator M.
The value in the concatenated accumulators is assumed to be a 32-bit signed fraction
with an implied radix point aligned between bits 31 and 30.
EV and MV in the CCR are set according to the result of ACED operation.
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.