Floating-Point Formats
5-10
Rewrite the mantissa as:
Mantissa
1
0
.
1
0
1
0
0
0
0
0
0
0
0
Step 3: Shift the decimal point of the mantissa according to the value of the
exponent.
If the exponent is positive, shift the binary point to the right by the value
of the exponent. If the exponent is negative, shift the binary point to
the left.
For example, if
e = 2
10
and the
man = 01.11000000000
2
, then the
shifted mantissa becomes 0111.000000000
2
, which is equivalent to
7 in decimal.
If, on the other hand,
e = –2
10
and
man = 01.10000000000
2
, then the
shifted mantissa becomes 0.0110000000000
2
, which is equivalent
to 3/8 in decimal.
The following examples illustrate how you can obtain the equivalent
floating-point value of a number in ‘C3x floating-point format. Each
of the examples uses the single-precision floating-point format.
Example 5–1. Positive Number
0 2 4 0 0 0 0 0
Hex value
0000 0010 0100 0000 0000 0000 0000 0000
Binary value
Exponent =
0000 0010
2
= 2
Sign
=
0
Fraction =
.10000
2
Value
=
01.1
2
×
2
2
= 0110
2
. = 6
Fraction
Implied
Sign