Вы находитесь на странице: 1из 7

This sheet requires the Analysis Toolpak to be loaded. Select the Tools Menu > Add-Ins...

> check Analysis Toolpack

most significant Least significant


high word low word
2 words decimal 16457 4059
hex 4049 0FDB
high byte
4 bytes decimal 64 73 15
hex 40 49 0F
32 bits binary 01000000 01001001 00001111

first bit 0
invert 1 SIGN

next 8 bits 10000000


decimal 128
subtract 127 1 EXPONENT

final 23 bits 10010010000111111011011


if no exponent bits
decimal 4788187 4788187
80 00 00 hex 8388608 4194304 40 00 00 hex
divide above and add 1 1.5707964 1.1415927 divide above
1.5707964 MANTISSA ( SIGNIFICAND )

FLOAT = SIGN x MANTISSA x ( 2 ^ EXPONENT )

FLOAT 3.1415927E+00

Courtesy of

www.simplymodbus.ca
Rev04 - Dec18, 2015
... > check Analysis Toolpack

Least significant
INSTRUCTIONS
< Enter these 2 words as decimal numbers
< or enter these 2 words in hex
low byte
219 < or enter these 4 bytes as decimal numbers
DB < or enter these 4 bytes in hex
11011011 < or enter these 4 bytes as 8 bit binary strings

alternate method of calculating the mantiss if No Exponent bits


for numbers near zero
positive numbers less than 1E-38 (numbers starting with less than
each row is half of that above negative numbers greater than -1E-38 (numbers starting with less
1 1 1
final 23 bits 1 0.5 0.5 0
0 0.25 0 0
0 0.125 0 0.125
1 0.0625 0.0625 0
0 0.03125 0 0
0 0.015625 0 0.015625
1 0.0078125 0.0078125 0
0 0.00390625 0 0
0 0.00195313 0 0
0 0.00097656 0 0
0 0.00048828 0 0.00048828
1 0.00024414 0.00024414 0.00024414
1 0.00012207 0.00012207 0.00012207
1 6.1035E-05 6.1035E-05 6.1035E-05
1 3.0518E-05 3.0518E-05 3.0518E-05
1 1.5259E-05 1.5259E-05 1.5259E-05
1 7.6294E-06 7.6294E-06 0
0 3.8147E-06 0 3.8147E-06
1 1.9073E-06 1.9073E-06 1.9073E-06
1 9.5367E-07 9.5367E-07 0
0 4.7684E-07 0 4.7684E-07
1 2.3842E-07 2.3842E-07 2.3842E-07
1 1.1921E-07 1.1921E-07
total 1.5707964 1.1415927

total 1.5707964 MANTISSA ( SIGNIFICAND )


umbers starting with less than 00 7F)
8 (numbers starting with less than 10 7F)
This sheet requires the Analysis Toolpak to be loaded. Select the Tools Menu > Add-Ins... > check Analysis Toolpack

FLOAT 1.2345000E+02 < Enter floating point number

FLOAT = SIGN x MANTISSA x ( 2 ^ EXPONENT )

1 SIGN
1st bit 0

6 EXPONENT
add 127 133
next 8 bits 10000101

1.9289063 MANTISSA ( SIGNIFICAND )


or if no exponent bits
subtract 1 0.9289063 1.9289063
80 00 00 hex 8388608 4194304
multiply 7792230 8090419
final 23 bits 11101101110011001100110

1110110
32 bits binary 01000010 11110110 11100110
4 bytes hex 42 F6 E6
decimal 66 246 230
byte1 byte2 byte3
high byte
2 words hex 42F6 E666
decimal 17142 58982
high word low word

most significant

alternate method of calculating the final 23 bits

subtract if result>0 1.9289063 "1" if result>0


1 0.9289063
0.5 0.42890625 1
0.25 0.17890625 1
0.125 0.05390625 1
0.0625 0.05390625 0
0.03125 0.02265625 1
0.015625 0.00703125 1
0.0078125 0.00703125 0
0.00390625 0.003125 1
0.001953125 0.001171875 1
0.0009765625 0.0001953125 1
0.0004882813 0.0001953125 0
0.0002441406 0.0001953125 0
0.0001220703 7.32421875E-05 1
6.103515625E-05 0.000012207 1
3.0517578125E-05 0.000012207 0
1.52587890625E-05 0.000012207 0
7.62939453125E-06 4.57763672E-06 1
3.814697265625E-06 7.62939453E-07 1
1.907348632813E-06 7.62939453E-07 0
9.536743164063E-07 7.62939453E-07 0
4.768371582031E-07 2.86102295E-07 1
2.384185791016E-07 4.76837159E-08 1
1.192092895508E-07 4.76837159E-08 0
5.960464477539E-08 4.76837159E-08 0
d-Ins... > check Analysis Toolpack

Courtesy of

www.simplymodbus.ca
Rev04 - Dec18, 2015

if no exponent bits
mantissa
40 00 00 hex
multiply

01100110
66
102
byte4
low byte

Least significant

if no exponent bits
for numbers near zero
1.9289063
0.92890625 1
0.42890625 1
0.17890625 1
0.05390625 1
0.05390625 0
0.02265625 1
0.00703125 1
0.00703125 0
0.003125 1
0.001171875 1
0.0001953125 1
0.0001953125 0
0.0001953125 0
7.32421875E-05 1
0.000012207 1
0.000012207 0
0.000012207 0
4.57763672E-06 1
7.62939453E-07 1
7.62939453E-07 0
7.62939453E-07 0
2.86102295E-07 1
4.76837159E-08 1
0
round up the previous bit if this bit is 1

Вам также может понравиться