IEEE 754, 32 bit representation, 1 bit for sign, 8 bits for Exponent and 23 bits for mantissa
Note that Exponent represented in Excess-127 format.
We have to represent -40.1, So
sign bit = 1
40 = 32+8 = (101000)$_2$
0.1 = (00011 0011 0011 0011 0011 00)$_2$ .......... represented with 23 bits
40.1 = 101000 . 00011 0011 0011 0011 0011 00 ----------------- in binary form.
= 1 . 01000 00011 0011 0011 0011 0011 00 * 2$^5$ ----- NOW it is in 1.M format, Keep only 23 bits in Mantissa
= 1 . 01000 00011 0011 0011 0011 0 * 2$^5$ ----- NOW it is in 1.M format, and Mantissa have 23 bits only.
True exponent is 5 ( which is in power of 2) ==> Excess Exponent value = 5+127 = 132 = 128 + 4 = 10000100
total representation is like:
sign |
Exponent |
Mantissa |
1 |
10000100 |
01000000110011001100110 |
Finally it is like (11000010001000000110011001100110)$_2$
1100 0010 0010 0000 0110 0110 0110 0110 ==> 0xC2206666