EasyManua.ls Logo

Delta DVP-PM Series - Page 176

Delta DVP-PM Series
561 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
5 Categories and Use of Basic Application Instructions
DVP-PM Application Manual 5-39
API Mnemonic Operands Function
22
D MUL P
Multiplication
Controllers
20PM 10PM
Bit Devices Word Devices Program Steps
Type
OP
X Y M S K H KnX KnY KnM KnS T C D V Z
S
1
* * * * * * * * ***
S
2
* * * * * * * * ***
D
* * *
MUL, MULP: 7 steps
DMUL, DMULP: 9 steps
Operands:
S
1
: Multiplicand S
2
: Multiplicator D: Product
Explanations:
1. MUL instruction multiplies S
1
by S
2
in BIN format and stores the result in D. Care should be taken on
positive/negative signs of S
1
, S
2
and D when doing 16-bit and 32-bit operations.
2. When MUL is used as 16-bit instruction, Z device cannot be adopted; when MUL is used as 32-bit instruction, V
device cannot be adopted.
3. In 16-bit BIN multiplication:
b15................ b00
X=
b15................ b00 b31............ b16 b15.............b00
+1
b15 is the sign bit b15 is the sign bit
b31 is hte sign bit(b15 of D+1)
b15=0,S1 is a positive value
B15=1,S1 is a negative value
b15=0,S2 is a positive value
b15=1,S2 is a negative value
b31=0,D(D+1) is a positive value
b31=1, is a negative valueD(D+1)
4. In 32-bit BIN multiplication:
b31.. b16
X
=
+1
b31 is the sign bit b31 is the sign bit
b63 is the sign bit(b15 of D+3)
B31=0,S1(S1+1) is a positive value
b31=1,S1(S1+1) is a negative value
b31=0,S2(S2+1) is a positive value
b31=1,S2(S2+1)
is a negative value
b63=0, D~(D+3) is a positive value
b63=1, D~(D+3) is a negative value
b15.. b00 b31..b16 b15.. b00
+1
b63. b48 b47. b32 b31. b16 b15. b00
+3 +2 +1
Program Example:
The 16-bit D0 is multiplied by the 16-bit D10 and brings forth a 32-bit product. The higher 16 bits are stored in D21
and the lower 16-bit are stored in D20. ON/OFF of MSB indicates the positive/negative status of the operation result.
X0
MUL D0 D10 D20
MUL D0 D10 K8M0

Table of Contents

Related product manuals