AH500 Programming Manual 
6-498 
API    Instruction code
Operand 
Function 
2121    FREXP  P 
S
1
, S
2
, D 
Converting the Binary-coded 
decimal floating-point number into 
the floating-point number 
Device
X  Y  M  S  T  C  HC  D  L  SM  SR  E  PR  K  16#  “$”  DF 
Pulse instruction  16-bit instruction (7 steps)  32-bit instruction 
AH500  AH500  - 
Symbol: 
S
1
: 
Binary-coded decimal 
floating-point number 
Word 
S
2
: 
Number of places  Word 
D
: 
Conversion result  Double word 
Explanation: 
The binary-coded decimal floating-point number in S
1
 is converted into the floating-point number 
first, and then the decimal point in the floating-point number is moved to the left in accordance with 
the setting of S
2
. The final result is stored in D. 
 
D
 
D
+1
S1
+1
+2
+3
+4
S1
S1
S1
S1
S2
Binary-coded decimal 
floating-point number
Sign
Seven-digit 
binary-coded
decimal number
Sign (Exponent)
Exponent
Number of places
Floating-point number
 
The binary-coded decimal floating-point number format: 
1.  If the binary-coded decimal floating-point number is a positive number, the value in S
1
 is 0. If 
the binary-coded decimal floating-point number is a negative number, the value in S
1
 is 1. 
2.  The seven-digit binary-coded decimal number is stored in (S
1
+2, S
1
+1). 
3.  If the exponent is a positive number, the value in S
1
+3 is 0. If the exponent is a negative 
number, the value in S
1
+3 is 1. 
4.  S
1
+4: The exponent   
The value in S
1
+4 should be within the range between 0 and 38. 
5.  S
2
: The number of places 
The value in S
2
 should be within the range between 0 and 7. 
Example: 
When the conditional contact MO is ON, the binary-coded decimal floating-point number is 
converted into the floating-point number.