In: Computer Science
Determine the representation for the following decimal numbers in single-precision IEEE 754 format. Give them in 32-bit binary and show the calculation.
-10^(−8)
single-precision IEEE 754 format:
1:sign bit
8:exponent bits
23:mantissa bits
total :32 bits
------------------------------------
now,
converting -10^(-8)= -0.00000001 to 32 bit single-precision IEEE
754 format:
1)
sign bit value is :1 //since given number is negative
2)
converting 0.00000001 to
binary:0.00000000101010111100110001110111000100011000010001100001110100
3)
Normalizing:(changing number so that, there is only one 1 before
decimal point)
0.00000000101010111100110001110111000100011000010001100001110100
=> 1.01010111100110001110111000100011000010001100001110100
//9 bits shifted left
3)Mantissa: the part after the decimal point is mantissa(upto 23
bits, if less then padd 0's, if more then ignore remaining)
01010111100110001110111
4)Exponent: 127 + (sign shifted number of bits) //sign is - for
left shift, + for right shift
127 + (- 9) = 116
116 to binary : 01110100
------------------------------------
Result:
sign|Exponent| Mantissa
1 |01110100| 01010111100110001110111