5.3 Standard Arithmetic Functions
5.3.1 Addition
5-123
5
APPLICATION
FUNCTIONS
ADD(_E)
ADD(_E)
(4) If an underflow/overflow occurs in the operation result, data is output from as follows.
(a) Word (signed) type data
No operation error occurs even if an underflow/overflow occurs.
In case of ADD_E, TRUE is output from ENO.
(b) Double word (signed) type data
No operation error occurs even if an underflow/overflow occurs.
In case of ADD_E, TRUE is output from ENO.
Operation result
(1) Function without EN/ENO
An operation is executed and the operation value is output from .
(2) Function with EN/ENO
The following table shows the executing conditions and operation results.
*1 When FALSE is output from ENO, the data output from is undefined.
In this case, create a program so that the data output from is not used.
32767 + 2 = −32767 Since the highest-order bit is 1, the result
value is negative.
(7FFF
H) (0002H) (8001H)
−32767 + (−2) = 32766 Since the highest-order bit is 0, the result
value is positive.
(8000
H) (FFFEH) (7FFEH)
2147483647 + 2 = −2147483647 Since the highest-order bit is 1, the result
value is negative.
(7FFFFFFF
H) (0002H) (80000001H)
−2147483648 + (−2) = 2147483646 Since the highest-order bit is 0, the result
value is positive.
(80000000
H) (FFFEH) (7FFFFFFEH)
EN ENO
TRUE (Operation execution) TRUE Operation output value
FALSE (Operation stop)
FALSE
*1
Undefined value
d
d
d
d
d