3. Instruction Set
MN05003003E For more information visit: www.eaton.com
3-23
S
exponent
mantissa
8-bit 23-bit
b31
Sign bit
0: positive
1: negative
b0
The range of a 32-bit floating point value is from ±2
-126
to
±2
+128
, i.e. from ±1.1755×10
-38
to
±3.4028×10
+38
.
Example 1: using 32-bit floating point to represent decimal number 23
Step 1: convert 23 to binary number: 23.0=10111
Step 2: Normalizing the binary: 10111=1.0111 × 2
4
,
0111 is mantissa and 4 is an exponent.
Step 3: get exponent: E∵ -B=4 →E-127=4 E=131=10000011∴
2
Step 4: We can now combine the sign, exponent, and normalized mantissa into the binary IEEE
short real representation.
0 10000011 01110000000000000000000
2
=41B80000
16
Example 2: using 32-bit floating point to represent decimal number –23
The conversion steps are the same as decimal number 23. Only need to modify sign bit from 0 to 1
to get value.
1 10000011 01110000000000000000000
2
=C1B80000
16
ELC also uses two registers with continuous number to store binary floating point. The following is
the example that uses register (D1, D0) to store binary floating point.
S E7 E6 E5 E1 E0 A22 A21 A20 A6 A5 A4 A3 A2 A1 A0
b0b1b2b3b4b5b6b20b21b22b23b24b28b29b30b31
2 22 222 22 2 222 222
7 6 5 1 0 -1 -2 -3 -17 -18 -19 -20 -21 -22 -23
D1(b15~b0) D0(b15~b0)
E0~E7=0 or 1 A0~A22=0 or 1
8 bits of exponent
23 bits of constant
sign bit (0: positive 1:negative)
When b0~b31 is 0, the content is 0.
Decimal Floating Point
1. Binary floating point is not practical for most applications, therefore, binary floating point
format can be converted to decimal floating point format for performing floating point math..
2. Decimal floating point values are stored in two consecutive registers. The least significant
register is where the constant value (mantissa) is stored and the upper register is where the
exponent is stored.
For example, using registers (D1, D0) to store a decimal floating point value.
Decimal floating point = [constant D0] X 10
[exponent D1 ]
constant D0 = ±1,000~±9,999, exponent D1 = - 41~+35