Relays, Memory Areas and Constants
1-84
1.5.2 Overflow and Underflow
Operation instructions occasionally produce a value which is outside of the allowed
range. This is called overflow if the value exceeds the maximum value and underflow
if the value falls short of the minimum value. When an overflow or underflow occurs, the
carry flag R9009 turns on.
Overflow and underflow during binary operation
If any of the following values are exceeded, overflow or underflow will result.
K-2147483648
32−bit binary operation
(Overflow results if over
the maximum value.)
16−bit binary operation
(Overflow results if over
the maximum value.)
K 32767 H 7FFF
K1
K0
K −1
H 0001
H 0000
H FFFF
K-32768 H 8000
K 2147483647 H 7FFFFFFF
K1
K0
K −1
H 00000001
H 00000000
H FFFFFFFF
H 80000000
Max. value
Min. value
(Underflow results if under
the minimum value.)
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
(Underflow results if under
the minimum value.)
Overflow and underflow during BCD operation
If any of the following values are exceeded, overflow or underflow will result.
Only positive values can be handled.
Max. value
H 99999999
H0
4−digit BCD code operation
(Overflow results if over the
maximum value.)
8−digit BCD code operation
(Overflow results if over the
maximum value.)
H 9999
H0
Min. value
.
.
.
.
.
.
.
.
.
.
.
.
(Underflow results if under
the minimum value.)
(Underflow results if under
the minimum value.)