In denary the integer 25000 can be written as
This number is in floating
point format :
Mantissa x
10Exponent
In binary, though, we express the exponent as a power of 2, so every binary
floating point number is of the form :
The mantissa would be a fixed point
fraction and the exponent would be an
integer.
There can be many floating point representations of the same number...
For example, the integer 40 can be written as
= 20 x 21
= 10 x 22
= 5 x 23
= 2.5 x 24
= 1.25 x 25
= 0.625 x 26
!!!Which one do we use?..Well the answer is : We use the last one where the
mantissa lies between 0.5 and 1 - this is said to be in normalised form and is the most accurate.
Example
A floating point number system uses 16-bit numbers. 8 bits for
the (signed)mantissa, and 8 bits for the (signed) exponent.
Convert the following binary number to denary.
01010001 00000101
Step 1 : The Exponent 00000101
This is a positive integer :
Sign |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
1 |
The exponent value is 4 + 1 =
5
Step 2 :
The Mantissa 0.1010001
This is a positive fraction (binary point after the sign bit):
The exponent is 5 ...so perform an arithmetic left shift 5 times...
0.1010001
01.010001 (once)
010.10001 (twice)
0101.0001 (3 times)
01010.001 (4 times)
010100.01 (5 times)
Sign |
16 |
8 |
4 |
2 |
1 |
. |
0.5 |
0.25 |
0 |
1 |
0 |
1 |
0 |
0 |
. |
0 |
1 |
The final answer :
19.25
|