Delta Electronics AH500 Manual page 154

Motion control module
Hide thumbs Also See for AH500:
Table of Contents

Advertisement

API
Instruction code
22
D
MUL
Device
X
Y
M
S
1
S
2
D
E xp la nat io n
E xa mple
5 - 3 9
P
S
K
16#
F
Pulse instruction 16-bit instruction (7 steps) 32-bit instruction (9 steps)
S
: Multiplicand; S
: Multiplier; D: Product
1
2
The signed binary value in S
S
, and the product is stored in D. Users have to notice the sign bits in
2
S
, S
, and D when 16-bit binary multiplication or 32-bit binary
1
2
multiplication is done.
16-bit binary multiplication
S
1
b15..............b0
b15..............b0
X
Bit 15 is a si gn bit. Bit 15 is a si gn bit.
Sign bit=0 (Positive sign); Sign bit=1 (Negative sign)
32-bit binary multiplication
S
S
+1
S
+1
2
1
1
b31...b16 b15...b0
b31...b16 b15...b0
X
Bit 31 is a si gn bit.
Bit 31 is a si gn bit.
Sign bit=0 (Positive sign); Sign bit=1 (Negative sign)
The 16-bit value in D0 is multiplied by the 16-bit value in D10, and the
32-bit product is stored in (D21, D20). The bits in D21 is the high 16 bits
in (D21, D20), whereas the bits in D20 is the low 16 bits in (D21, D20).
Whether the product is a positive value or a negative value depends on
the leftmost bit in (D21, D20).
X0.0
Ch ap te r 5 Ap plie d Instruc tions
Operand
S
, S
, D
1
2
KnM KnS
D
W
is multiplied by the singed binary value in
1
S
D
2
b31.........b16
=
Bit 31 is a si gn bit.
(B it 15 in D+1 is a sign bit.)
S
D
+3
D
2
b63...b48 b47...b32 b31...b16 b15...b0
=
Bit 63 is a si gn bit.
(B it 15 in D+3 is a s ign bit.)
MU L
D 0
D10
MU L
D 0
D10
Function
Binary multiplication
T
C
V
Z
D
+1
b15...........b0
D
D +1
+2
D20
K 8M 0

Advertisement

Table of Contents
loading

Table of Contents