5 Applied Instructions and Basic Usage
DVP-20PM Application Manual
5-102
API
Applicable model
20PM
122
D
D
EMUL
P
P
Binary floating-point multiplication
Bit device Word device
X Y M S F H KnX KnY KnM KnS T C D V Z
S
1
*
*
S
2
*
*
D
*
Note: Please refer to specifications for more information about device
ranges.
F represents a floating-point value. There is a decimal point in a
floating-point value.
Onlyt the 32-bit instructions DEMUL and DEMULP are valid.
16-bit instruction
- - - -
32-bit instruction (9 steps)
DEMUL
Continuity
instruction
DEMULP
Pulse
instruction
Flags
Ox O100
M1810 M1970 Carry flag
Please refer to the additional remark below.
Explanation
The binary floating-point value in S
1
is multiplied by the binary floating-point
value in S
2
, and the product is stored in D.
S
1
: Multiplicand; S
2
: Multiplier; D: Product
If S
1
is a floating-point value, the instruction will be used to multiply S
1
by the
binary floating-point value in S
2
. If S
2
is a floating-point value, the instruction
will be used to multiply the binary floating-point value in S
1
by S
2
.
S
1
and S
2
can be the same register. If the instruction DEMUL is used under the
circumstances, the value in the register is multiplied by itself whenever the
conditional contact is ON in a scan cycle. Generally, the pulse instruction
DEMULP is used.
If the absolute value of an oepration result is greater than the maximum
floating-point value available, a carry flag will be ON.
If the absolute value of an oepration reuslt is less than the minimum
floating-point value available, a borrow flag will be ON.
If an operation result is 0, a zero flag will be ON.
Example 1
When X1 is ON, the binary floating-point value in (D1, D0) is multiplied by the
binary floating-point value in (D11, D10), and the product is stored in (D21,
D20).
X1
DEMUL D0 D10 D20
Example 2
When X2 is ON, F1234.0 is multiplied by the binary floating-point value in (D1,
D0), and the product is stored in (D11, D10).
X2
DEMUL D0
F1234.0
D10
Additional
remark
Please refer to section 5.3 for more information about performing operations
on floating-point values.