Floating Point Number Representation
Floating Point Number Representation
As the name implies, floating point numbers are numbers that contain
floating decimal points. For example, the numbers 5.5, 0.001, and
-2,345.6789 are floating point numbers. Numbers that do not have
decimal places are called integers.
1.111001
Mantissa Exponent
2 65 0
2 32 1
2 16 0
2 8 0
2 4 0
2 2 0
1 0
10000010
Mantissa - 111001
Sign - 0
Example 2: Represent -10.675 using IEEE 754 – 32 bit representation
Step 01: The sign of the number is – therefore sign bit has 1
Step 2: Covert the number into binary
10.675
2 10 0.625*2 = 1.25 1
2 5 0 0.25*2 = 0.5 0
2 2 1 0.5*2 = 1.0 1
1 0
0
10.675 = 1010.101
1010.101
normalization
1.010101
mantissa
exponent
2 65 0
2 32 1
2 16 0
2 8 0
2 4 0
2 2 0
1 0
10000010
Mantissa - 010101
Sign - 1
In 64 bit representation, only few differences are there
1st bit is the sign bit 1st bit is the sign bit
Next 8 bits are to biased exponent Next 11 bits are to biased exponent
Next 23 bits are to mantissa Next 52 bits are to mantissa
Biased exponent = exponent+127 Biased exponent=exponent+1023
Step 01: The sign of the number is – therefore sign bit has 1
Step 2: Covert the number into binary
10.675
2 10 0.625*2 = 1.25 1
2 5 0 0.25*2 = 0.5 0
2 2 1 0.5*2 = 1.0 1
1 0
0
10.675 = 1010.101
1010.101
normalization
1.010101
mantissa
exponent
2 513 0
2 256 1
2 128 0
2 64 0
2 32 0
2 16 0
2
8 0
2
4 0
2 2 0
1 0
10000000010
Mantissa - 010101
Sign - 1
Now let’s see how to convert a floating point binary
number in to decimal
10000010
16 8
128 64 32 4 2 1
(128*1)+(2*1)
=130
Step 2.Find the exponent
1.010101
Let’s de-normalize now
1010.101
(8*1)+(2*1)+(0.5*1)(0.125*1)
10.625 is the number represented