Floating Point Examples

(fraction representation)

 

Try checking these results at http://babbage.cs.qc.edu/courses/cs341/IEEE-754.html

 

 

 

0 10000001 000 0000 0000 0000 0000 0000

=  +2(129-127)  x 1.0

=  +22

=  +4

 

1 10000001 000 0000 0000 0000 0000 0000

=  -2(129-127)  x 1.0

=  -22

=  -4

 

0 10001111 000 0000 0000 0000 0000 0000

=  +2(143-127)  x 1.0

=  +216

=  +65 456

 

0 01111111 100 0000 0000 0000 0000 0000

=  +2(127-127)  x 1.1 (the fullstop here is a binary point not a decimal point)

=  +20  x 1½

=  +1.5

 

0 01111111 110 0000 0000 0000 0000 0000

=  +2(127-127)  x 1.11 (the fullstop here is a binary point not a decimal point)

=  +20  x 1(½+¼)

=  +1.75

 

0 10000001 111 0000 0000 0000 0000 0000

=  +2(129-127)  x 1.111 (the fullstop here is a binary point not a decimal point)

=  +22  x 1.111

=  +111.1 (move the binary point two places to the right)

 

111.1 is 7.5 in decimal

 

This could have been worked out in another way

=  +22  x 1.111 (in binary)

=  +4 x ( 1+½+¼+⅛) (in decimal)

=  + 4 + 2 + 1 + ½

=  +7.5

 

The biggest positive number that can be represented is

0 11111110 111 1111 1111 1111 1111 1111

=  +2(254-127)  x 1.111 1111 1111 1111 1111 1111

=  +2127 x 1.111 1111 1111 1111 1111 1111

=  +2104 x 1111 1111 1111 1111 1111 1111

= +2104(+224 – 1)

 

The smallest positive number that can be represented is

0 00000001 000 0000 0000 0000 0000 0000

=  +2(1-127)  x 1.0

=  +2(-126) 

 

Infinity is NotaNumber or NaN

0 11111111 000 0000 0000 0000 0000 0000

11111111 is 255 in decimal

 

Zero is

0 00000000 000 0000 0000 0000 0000 0000

 

    

Hosted by www.Geocities.ws

1