Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
472
18 Applied Instructions (Floating Point)
18.12 DEXP / Floating Point Exponent
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
Error
In the following cases, it is an operation error, error flag (M8067) is turned ON, and error code is stored in
D8067.
When the operation result is out of the following range. (Error code: K6706)
2
-126
| Operation result | < 2
128
Program example
This is a program for executing exponential operation of the values set in BCD two digits in X020 to X027
when the X000 is turned ON, and storing in binary floating decimal points D0, D1.
Operation when 13 is specified in X020 to X027.
Points
1) The operation result is less than 2
128
only when the BCD value of X020 to X027 is smaller than 88,
because log e 2
128
= 88.7. When a value greater than 89 is specified, it is an operation error, and
therefore when a value greater than 89 is specified, M0 is turned ON, so that the operation is not carried
out.
2) Conversion from natural logarithm into common logarithm
The CPU operates in natural logarithm.
To determine value in common logarithm, please specify the value of common logarithm divided by
0.4342945 in +1, .
[Structured ladder/FBD]
X000
D20
BIN
EN
s
ENO
K2X20
LD>
EN
s1
ENO
D20
D20
FLT
EN
s
ENO
d
d
D10
[ST]
The Load compare instruction (LD>) is not available in ST.
s2
K88
M0
DEXP
EN
s
ENO
d
D0D10
M0
Input of data for
exponential operation (1))
Checking of range of operation values
(see the following check point 1).
Input data is converted into binary
floating decimal point (real number).(2))
Exponential operation(3))
Value of binary floating
decimal point (real number)
13
1 3
1) BIN
conversion
BIN
13
b15 b0
2) Conversion of binary
floating decimal point
(real number)
3) EXP conversion
EXP
D11 D10
Value of binary floating
decimal point (real number)
442413.4
D1 D0
FLT
D20
X027 X020
BCD value BIN value
10
=
e
0.4342945
X
X