Bin 32-Bit Addition And Subtraction Operations - Mitsubishi MELSEC-Q/L Programming Manual

Table of Contents

Advertisement

6.2.2
D+, D+P, D-, D-P

BIN 32-bit addition and subtraction operations

6.2.2
D+, D+P, D-, D-P
When two data are set (( +1, )+( +1, ) ( +1, ), ( +1, )-( +1, ) ( +1, ))
D+, D
D+P, D P
: Data for additing/subtracting or head number of the devices where the data for additing/subtracting is stored (BIN 32 bits)
S
: Head number of the devices where the data to be added to/subtracted from is stored (BIN 32 bits)
D
Setting
Internal Devices
Data
Bit
Word
S
D
Function
D+
(1) Adds 32-bit BIN data designated by
device designated by
D
(2) The values for
and
S
D
(3) Judgment of whether the data is positive or negative is made on the basis of the most significant bit (b31).
• 0: Positive
• 1: Negative
(4) The following will happen when an underflow or overflow is generated in an operation result:
The carry flag in this case does not go ON.
+K2
K2147483647
(00000002
(7FFFFFFF
)
H
K 2147483648
+K 2
(80000000
)
(FFFFFFFE
H
D-
(1) Subtracts 32-bit BIN data designated by
at the device designated by
(2) The values for
and
S
D
(3) Judgment of whether the data is positive or negative is made on the basis of the most significant bit (b31).
• 0: Positive
• 1: Negative
D
D
S
S
D
D
Command
Command
J
\
R, ZR
Bit
to 32-bit BIN data designated by
D
.
D
D
S
+1
b31
b16 b15
b0
b31
567890 (BIN)
123456 (BIN)
can be designated at between -2147483648 and 2147483647 (BIN 32 bits).
K
2147483647
Since bit 31 value is "1",
)
(80000001
)
H
H
result of operation takes a negative value.
K2147483646
Since bit 31 value is "0",
)
(7FFFFFFE
)
H
H
result of operation takes a positive value.
from 32-bit BIN data designated by
D
.
D
S
D
D
+1
b31
b16 b15
b0
b31
567890 (BIN)
123456 (BIN)
can be designated at between -2147483648 and 2147483647 (BIN 32 bits).
High
Basic
performance
D
D
S
S
D
indicates an instruction symbol of
P
U
\G
Word
, and stores the result of the addition at the
S
S
D
+1
+1
b16 b15
b0
b31
b16 b15
691346 (BIN)
and stores the result of the subtraction
S
S
D +1
+1
b16 b15
b0
b31
b16 b15
444434 (BIN)
D+, D+P, D-, D-P
Process
Redundant Universal
LCPU
D
D+/
D
.
S
D
S
D
Constants
Zn
Other
K, H
––
D
b0
D
b0
1
2
3
4
––
6
––
7
8
191

Advertisement

Table of Contents
loading

Table of Contents