531
EXP, EXPP
1
2
3
4
4
6
7
8
7.12 Special function instructions
7.12.21 EXP, EXPP
Operation Error
(1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into
SD0.
*2: There are CPU modules that will not result in an operation error if -0 is specified.
For details, refer to Page 88, Section 3.2.4.
Program Example
(1) The following program performs an exponent operation on the value set by the 2 BCD digits at X20 to X27, and stores
the results as a 32-bit floating decimal point real number at D0 and D1.
[Ladder Mode]
[List Mode]
[Operations involved when value designated by X20 to X27 is 13]
*4: The operation result will be under 2
129
if the BCD value of X20 to X27 is less than 89, from the calculation loge 2
129
= 89.4.
Because setting a value of over 90 will return an operation error, turn M1 ON if a value of over 90 has been set to avoid the
error.
Error
code
Error details
Q00J/
Q00/
Q01
QnH QnPH QnPRH QnU LCPU
4100
The operation result is not within the following range:
2
-126
| Operation result | < 2
128
–– –– –– –– ––
The operation result is not within the following range:
2
-126
| Operation result | < 2
128
–– –– ––
The specified device value is -0.
*2
–– ––
4140
The specified device value is -0, unnormalized number, nonnumeric, or
±.
–– –– –– ––
4141
The operation result exceeds the following range (when an overflow
occurs):
2
128
| Operation result |
–– –– –– ––
Inputs the data used for
exponent operation ( ).
Converts the input data into
a 32-bit floating-point real number ( ).
Executes exponent operation ( ).
Checks the range of the
value for operation. *4
1
2
3
Step Instruction Device
BCD value
D20
13
X20
Conversion
to BIN
BIN
b15 b0
BIN value
13
Conversion to
floating-point
FLT
EXP operation
D11 D10
EXP
D1 D0
X27
32-bit floating-point
real number
32-bit floating-point
real number
1
3
442 4 1
3
.
4
1
2
3