User manual
12 MODBUS RTU, ASCII, TCP
English
2.3 Floating point as per IEEE Standard
The basic format allows a IEEE standard floating-point number to be represented in a single 32 bit format, as
shown below:
N.n = (-1)
S
2
e’-127
(1.f )
where S is the sign bit, e’ is the first part of the exponent and f is the decimal fraction placed next to 1. Internally
the exponent is 8 bits in length and the stored fraction is 23 bits long.
A round to nearest method is applied to the calculated value of floating point.
The floating-point format is shown as follows:
======================
| S | e + 127 | f |
======================
31 30 23 22 0 <—
bit number
where:
bit length
Sign 1
Exponent 8
Fraction 23 + (1)
Total m = 32 + (1)
Exponent
Min e’ 0
Max e’ 255
Bias 127
NOTE
Fractions (decimals) are always shown while the leading 1 (hidden bit) is not stored.
EXAMPLE OF CONVERSION OF VALUE SHOWN WITH FLOATING POINT
Value read with floating point:
45AACC00(
16
)
Value converted in binary format:
sign
exponent fraction
010001011 01010101100110000000000 (
2
)
sign = 0
exponent = 10001011(
2
) = 139(
10
)
fraction = 01010101100110000000000(
2
) / 8388608 (
10
) =
= 2804736 (
10
) / 8388608 (
10
) = 0.334350585 (
10
)
N.n = (-1)
S
2
e’-127
(1+f ) =
= (-1)
0
2
139-127
(1.334350585) =
= (+1) (4096) (1.334350585) =
= 5465.5