6. BASIC INSTRUCTIONS
6
−
9
MELSEC-A
Arithmetic operation with BIN (Binary)
•
If the operation result of an addition instruction exceeds 32767 (2147483647 in the
case of a 32-bit instruction), the result becomes a negative value.
•
If the operation result of a subtraction instruction is less than - 32768
(-2147483648 in the case of a 32-bit instruction), the result becomes a positive
value.
•
The operation of a positive value and a negative value is as follows:
5 + 8
→
13
5 - 8
→
-3
5
×
3
→
15
-5
×
3
→
-15
-5
×
(
−
3)
→
15
-5 / 3
→
-1 and remainder -2
5 / (
−
3)
→
-1 and remainder 2
-5 / (
−
3)
→
1 and remainder -2
Arithmetic operation with BCD
•
If the operation result of an addition instruction has exceeded 9999 (99999999 in
the case of a 32-bit instruction), carry is ignored.
•
When the subtrahend is less than the minuend in the subtraction instruction, the
following occurs.
Carry is ignored.
Summary of Contents for MELSEC-A series
Page 1: ......
Page 2: ......
Page 13: ...A 11 MEMO...
Page 505: ...APPENDICES APP 100 MELSEC A MEMO...
Page 507: ......
Page 508: ......