Arithmetic Operation Instruction - Mitsubishi Electric MELSEC-Q/L Programming Manual

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

Advertisement

6.2
Arithmetic Operation Instructions
BIN 16-bit addition and subtraction operations
+(P), -(P) [When two data are set]
High
Basic
Process
performance
+,
+P, P
(S): Data for adding/subtracting or head number of the devices where the data for adding/subtracting is stored (BIN 16 bits)
(D): Head number of the devices where the data to be added to/subtracted from is stored (BIN 16 bits)
Setting
Internal device
data
Bit
(S)
(D)
Processing details
■+
• Adds 16-bit BIN data designated by (D) to 16-bit BIN data designated by (S) and stores the result of the addition at the
device designated by (D).
D
b15
b0
5678 (BIN)
• Values for (S) and (D) can be designated between -32768 and 32767 (BIN, 16 bits).
• The judgment of whether data is positive or negative is made by the most significant bit (b15).
• 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.
K32767 +K2
(0002
)
(7FFF
)
H
H
K 32768 +K 2
(FFFE
)
(8000
)
H
H
6 BASIC INSTRUCTIONS
220
6.2 Arithmetic Operation Instructions
LCPU
Redundant Universal
Command
Command
R, ZR
Word
S
b15
b0
b15
1234 (BIN)
K 32767
Since bit 15 value is "1",
(8001
)
H
result of operation takes a negative value.
Since bit 15 value is "0",
K32766
(7FFE
)
result of operation takes a positive value.
H
J\
Bit
Word
D
b0
6912 (BIN)
indicates an instruction symbol of
S
D
P
S
D
U\G
Zn
Constant
K, H
+/
.
Others

Advertisement

Table of Contents
loading

Table of Contents