197
D*, D*P, D/, D/P
1
2
3
4
6
7
8
6.2
A
rithmetic Opera
tion In
str
uctions
6.2.4
D
*, D*P, D/, D
/P
D/
(1) Divides BIN 32-bit data designated by and BIN 32-bit data designated by , and stores the result in the device
designated by .
(2) With a word device, the division operation result is stored in 64 bits and both the quotient and remainder are stored. With
a bit device, only the quotient is stored as the operation result in 32 bits.
Quotient
:
Stored at the lower 32 bits.
Remainder :
Stored at the upper 32 bits (Stored only when using a word device).
(3) The values for and can be designated at between -2147483648 and 2147483647 (BIN 32 bits).
(4) Judgment
whether
values
for
, ,
and +2
are
positive
or negative is made on the basis of the most significant bit
(b31).
(Sign is attached to both the quotient and remainder.)
• 0: Positive
• 1: Negative
Operation Error
(1) In any of the following cases, an operation error occurs, the error flag (SM0) is turned ON, and the corresponding error
code is stored into SD0.
Program Example
(1) The following program multiplies the BIN data at D7 and D8 by the BIN data at D18 and D19 when X5 is ON, and stores
the result at D1 to D4.
[Ladder Mode]
[List Mode]
(2) The following program outputs the value resulting when the data at X8 to XF is multiplied by 3.14 to Y30 to Y3F when X3
is ON.
[Ladder Mode]
[List Mode]
Error
code
Error details
Q00J/
Q00/
Q01
QnH
QnPH QnPRH
QnU
LCPU
4100
The divisor is 0.
S1
S2
D
123456
(
BIN
)
b0
b15
567890
(
BIN
)
b31
4
(
BIN
)
74066
(
BIN
)
S1
S2
D
D
D
D
b16
S1
b0
b15
b31 b16
S2
b0
b15
b31 b16
b0
b15
b31 b16
S1
S2
S1
S2
D
D
Step
Instruction
Device
Step
Instruction
Device