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.