Floating Point Answers
Example 1 : 123.046875
We are using
8 bits for the exponent
16 bits for the mantissa
(1 is the sign bit)
123.046875
Sign = 0 (+ve)
Integer = 123 = 0111 1011
Decimal portion = .0.000011-> Number = 0111 1011.000011-> Needs to be 0.111 1011000011( Exponent shifted 7 places to the left)
Exponent = 7= 0000 0111
Number (Sign Mantissa Exponent) = 0 111 1011 0000 1100 00000111 (padding is in bold)
Example 2 : 124.28125
We are using
8 bits for the exponent
16 bits for the mantissa
(1 is the sign bit)
124.28125
Sign = 0 (+ve)
Integer = 124 = 0111 1100
Decimal portion = .000011> Number = 0111 1100.000011 -> Needs to be 01.111100000011( Exponent shifted 6 places to the left)
Exponent = 7= 0000 0111
Number (Sign Mantissa Exponent) = 0 111 1100 0000 1100 00000111 (padding is in bold)
Example 3 : 82.34375
We are using
8 bits for the exponent
16 bits for the mantissa
(1 is the sign bit)
3.34375
Sign = 0 (+ve)
Integer = 83 = 0000 0011
Decimal portion = .01011> Number = 0000 0011.01011 -> Needs to be 0000 001.101011 Exponent shifted 1 places to the left)
Exponent = 2 = 0000 0010
Number (Sign Mantissa Exponent) = 0 110 1011 0000 0000 0000 0010 (padding is in bold)