Mitsubishi Electric MELSEC-Q/L Programming Manual page 227

Hide thumbs Also See for MELSEC-Q/L:
Table of Contents

Advertisement

■D-
• Subtracts 32-bit BIN data designated by (D) from 32-bit BIN data designated by (S) and stores the result of the subtraction
at the device designated by (D).
S
D
D
+1
+1
b31
b16 b15
b0
b31
b16 b15
567890 (BIN)
123456 (BIN)
• The values for (S) and (D) can be designated at between -2147483648 and 2147483647 (BIN 32 bits).
• Judgment of whether the data is positive or negative is made on the basis of the most significant bit (b31).
• 0  Positive
• 1  Negative
• The following will happen when an underflow or overflow is generated in an operation result: The carry flag (SM700) in this
case does not turn ON.
K 2147483648 K2
(80000000
)
(00000002
)
H
H
K2147483647
K 2
(80000000
)
(FFFFFFFE
)
H
H
Operation error
• There is no operation error in the D+(P) or D-(P) instruction.
S
D +1
D
b0
b31
b16 b15
444434 (BIN)
Since bit 31 value is "0",
K2147483646
(7FFFFFFE
)
result of operation takes a positive value.
H
K
2147483647
Since bit 31 value is "1",
(80000001
)
H
result of operation takes a negative value.
b0
6.2 Arithmetic Operation Instructions
6 BASIC INSTRUCTIONS
225
6

Advertisement

Table of Contents
loading

Table of Contents