IEEE 754-2008 contains a half precision that is only 16 bits wide. The left most
ID: 3886156 • Letter: I
Question
IEEE 754-2008 contains a half precision that is only 16 bits wide. The left most bit is still the sign bit, the exponent is 5 bits wide and has a bias of 15, and the mantissa is 10 bits long. A hidden 1 is assumed. Write down the bit pattern to represent - 1.5625 * 10^-1 assuming a version of this format, which uses an excess-16 format to store the exponent. Calculate [3.984375 * 10^-1 + 3.4375 * 10^-1) + 1.771 * 10^3 by hand, assuming each of the values are stored in the 16-bit half precision format described in Exercise 1 (and also described in the text book). Show all the steps, and write your answer in both the 16-bit floating-point format and in decimal.Explanation / Answer
Solution:
6
a)
Sign(1 bit)
Exponent( 5 bit)
Mantissa (10 bit)
Given number is -1.5625 *10-1= -0.15625
The number is negative. So the sign bit is 1.
The number 0.15625 can be converted to binary as below.
0.15625*2=0.3125=0
0.3125*2=0.625 = 0
0.625*2 =1.25=1
0.25*2=0.5=0
0.5*2=1=1
(0.15625)10=0.00101=1.01*2-3
Bias=15
Exponent=bias+-3=15-3=12=(01100)2
Mantissa= 01000000
1
01100
0100000000
The bit pattern for the given number is 1011000100000000
b)
3.984375*10-1 = 0.3984375 = 0.0110011=1.10011*2-2
Exponent=-2+15 =13
0 01101 1001100000
3.4375*10-1=0.34375 = 0.01011=1.011*2-2
Exponent =-2+15=13
0 01101 0110000000
3.984375*10-1 +3.4375*10-1 =1.10011*2-2+1.011*2-2
=10.11111 *2-2
1.771*103=1771=0.1771=0.00101101010101100111
=00.101101010101100111*2-2
3.984375*10-1 +3.4375*10-1+1.771*103
=10.11111 *2-2 +00.101101010101100111*2-2
=11.101011010101100111 *2-2
=1.1101011010101100111*2-3
Exponent =12=1100
Truncate mantissa to 10 bits
Result =0 01100 1101011010
Sign(1 bit)
Exponent( 5 bit)
Mantissa (10 bit)