
7751 SERIES SOFTWARE MANUAL
4–92
RMPA
Repeat MultiPly and Accumulate
RMPA
Function
:
Repeat multiply and accumulation
Operation
:
E
s
indicates the sign bit and is the topmost bit of the data to be operated on.
i
, which is a positive number from 0 to 255, indicates the number of repeated operations. It
is specified by the third byte of the instruction.
Execute this instruction in the condition of index register length flag = “0”.
Allocate multipliers and multiplicands in the same bank. Do not allocate each of them across
other banks.
When the data length flag is “0”, performs signed multiplication of the 16-bit data in the
memory specified by index register X and data bank register, and the 16-bit data in the
memory specified by index register Y and data bank register. The multiplication result is added
as binary addition to the 32-bit data of which high-order is the contents of accumulator B, and
of which low-order is the contents of accumulator A. The high-order 16 bits of the addition
result are stored in accumulator B, and the low-order 16 bits are stored in accumulator A
again. After the addition, each of the contents of index register X and index register Y is
incremented by 2. Additionally, the number of repeated operations is decremented by 1, and
when the result is “0”, this instruction execution is finished. When the result is not “0”, the
above multiplication and addition are repeated.
When the data length flag (m) is “1”, performs signed multiplication of the 8-bit data in the
memory specified by index register X and data bank register, and the 8-bit data in the memory
specified by index register Y and data bank register. The multiplication result is added as
binary addition to the 16-bit data of which high-order is the contents of accumulator BL, and
of which low-order is the contents of accumulator AL. The high-order 8 bits of the addition
result are stored in accumulator BL, and the low-order 8 bits are stored in accumulator AL
again. After the addition, each of the contents of index register X and index register Y is
incremented by 1. Additionally, the number of repeated operations is decremented by 1, and
when the result is “0”, this instruction execution is finished. When the result is not “0”, the
above multiplication and addition are repeated.
E
E
E
Description
:
G
After finishing the instruction execution, index registers X, Y specify the next address of the
address where a multiplier and a multiplicand are read last.
G
When an overflow occurs at addition, the overflow flag becomes “1” and the instruction
execution is finished then. When an overflow occurs, accumulators A and B become
undefined. Index registers X, Y specify the next address of the address where a multiplier
and a multiplicand are read last.
G
When specifying “0” as the number of repeated operations, the instruction execution is
finished without multiplication and addition. The contents of accumulators A, B, and index
registers X, Y are not affected.
s
B
A
s
B
A
M(DT:X+1,DT:X)M(DT:Y+1,DT:Y)
+
s
Multiplicands
X X + 2
Y Y + 2
i = i – 1
RMPA
i = 0
s
B
L
A
L
s
B
L
A
L
M(DT:X)
s
Multiplicands
M(DT:Y)
s
Multiplier
s
Multiplier
=
0
≠
0
Finish
Next instruction
G
m = 0
G
m = 1
+
X X + 1
Y Y + 1