You are on page 1of 3

Float 

to Decimal Conversion
 Floating­Point Conversion Examples     Binary/Boolean Main Index

[Decimal to Floating­Point Conversions]   [Float to Decimal Conversion]

The Conversion Procedure
The rules for converting a floating point number into decimal are simply to reverse of the decimal to floating point
conversion:

A. If the original number is in hex, convert it to binary.
B. Separate into the sign, exponent, and mantissa fields.
C. Extract the mantissa from the mantissa field, and restore the leading one. You may also omit the trailing zeros.
D. Extract the exponent from the exponent field, and subtract the bias to recover the actual exponent of two. As before,
the bias is 2k−1 − 1, where k is the number of bits in the exponent field, giving 3 for the 8­bit format and 127 for the
32­bit.
E. De­normalize the number: move the binary point so the exponent is 0, and the value of the number remains
unchanged.
F. Convert the binary value to decimal. This is done just as with binary integers, but the place values right of the
binary point are fractions.
G. Set the sign of the decimal number according to the sign bit of the original floating point number: make it negative
for 1; leave positive for 0.

If the binary exponent is very large or small, you can convert the mantissa directly to decimal without de­normalizing.
Then use a calculator to raise two to the exponent, and perform the multiplication. This will give an approximate answer,
but is sufficient in most cases.

Examples Using The Conversion Procedure
Convert the 8­bit floating point number e7 (in hex) to decimal.
A. Convert: e716 = 111001112.
B. Seprate:  1 110 0111
C. Mantissa: 1.0111
D. Exponent: 1102 = 610; 6 − 3 = 3.
E. De­normalize: 1.01112 × 23 = 1011.1
F. Convert:
Exponents 23 22 21 20 2­1
Place Values 8 4 2 1 0.5
Bits 1 0 1 1 . 1
Value 8     + 2 + 1 + 0.5 = 11.5
G. Sign: negative.
Result: e7 is ­11.5
Convert the 8­bit floating point number 26 (in hex) to decimal.
a. Convert and separate: 2616 =  0 010 0110  2
b. Exponent: 0102 = 210; 2 − 3 = ­1.
c. Denormalize: 1.0112 × 2­1 = 0.1011.
d. Convert:
Exponents 20 2­1 2­2 2­3 2­4
Place Values 1 0.5 0.25 0.125 0.0625
Bits 0 . 1 0 1 1
Value 0.5 + 0.125 + 0.0625 = 0.6875
e. Sign: positive
Result: 26 is 0.6875.
Convert the 8­bit floating point number d3 (in hex) to decimal.
a. Convert and separate: d316 =  1 101 0011  2
b. Exponent: 1012 = 510; 5 − 3 = 2.
c. Denormalize: 1.00112 × 22 = 100.11.
d. Convert:
Exponents 22 21 20 2­1 2­2
Place Values 4 2 1 0.5 0.25
Bits 1 0 0 . 1 1
Value 4         + 0.5 + 0.25 = 4.75
e. Sign: negative
Result: d3 is ­4.75.
Convert the 32­bit floating point number 44361000 (in hex) to decimal.
a. Convert and separate: 4436100016 =  0 10001000 01101100001000000000000  2
b. Exponent: 100010002 = 13610; 136 − 127 = 9.
c. Denormalize: 1.011011000012 × 29 = 1011011000.01.
d. Convert:
Exponents 29 28 27 26 25 24 23 22 21 20 2­1 2­2
Place Values 512 256 128 64 32 16 8 4 2 1 0.5 0.25
Bits 1 0 1 1 0 1 1 0 0 0 . 0 1
Value 512     + 128 + 64     + 16 + 8             + 0.25 = 728.25
e. Sign: positive
Result: 44361000 is 728.25.
Convert the 32­bit floating point number be580000 (in hex) to decimal.
a. Convert and separate: be58000016 =  1 01111100 10110000000000000000000  2
b. Exponent: 011111002 = 12410; 124 − 127 = ­3.
c. Denormalize: 1.10112 × 2­3 = 0.0011011.
d. Convert:
Exponents 20 2­1 2­2 2­3 2­4 2­5 2­6 2­7
Place Values 1 0.5 0.25 0.125 0.0625 0.03125 0.015625 0.0078125
Bits 0 . 0 0 1 1 0 1 1
Value 0.125 + 0.0625 + 0.015625 + 0.0078125 = 0.2109375
e. Sign: negative
Result: be580000 is ­0.2109375.
Convert the 32­bit floating point number a3358000 (in hex) to decimal.
a. Convert and separate: a335800016 =  1 01000110 01101011000000000000000  2
b. Exponent: 010001102 = 7010; 70 − 127 = ­57.
c. Since the exponent is far from zero, convert the original (normalized) mantissa:
Exponents 20 2­1 2­2 2­3 2­4 2­5 2­6 2­7 2­8
Place
1 0.5 0.25 0.125 0.0625 0.03125 0.015625 0.0078125 0.00390625
Values
Bits 1 . 0 1 1 0 1 0 1 1
Value 1 + 0.25 + 0.125 + 0.03125 + 0.0078125 + 0.00390625 = 1.41796875
d. Use calculator to find 1.41796875 × 2­57. You should get something like 9.83913471531 × 10­18 .
e. Sign: negative
Result: a3358000 is about ­9.83913471531 × 10­18 .
Convert the 32­bit floating point number 76650000 (in hex) to decimal.
a. Convert and separate: 7665000016 =  0 11101100 11001010000000000000000  2
b. Exponent: 111011002 = 23610; 236 − 127 = 109.
c. Since the exponent is far from zero, convert the original (normalized) mantissa:
Exponents 20 2­1 2­2 2­3 2­4 2­5 2­6 2­7
Place Values 1 0.5 0.25 0.125 0.0625 0.03125 0.015625 0.0078125
Bits 1 . 1 1 0 0 1 0 1
Value 1 + 0.5 + 0.25 + 0.03125 + 0.0078125 = 1.7890625
d. Use calculator to find 1.7890625 × 2109. You should get something like 1.16116794981 × 1033 .
e. Sign: positive
Result: 76650000 is about 1.16116794981 × 1033 .

You might also like