Question
3.32 Let A=3.984375*10 -1 , B=3.4375*10 -1 , C= 1.771*10 3 be the three numbers in scientific notations in decimal. Calculate (A+B) + C by
3.32 Let A=3.984375*10-1, B=3.4375*10-1, C= 1.771*103 be the three numbers in scientific notations in decimal. Calculate (A+B) + C by hand, assuming each of the values are stored in the 16-bit half precision format described in Exercise 3.27 (and also described in the text). Assume 1 guard, 1 round bit, and 1 sticky bit, and round to the nearest even. Show all the steps, and write your answer in both the 16-bit floating point format and in decimal.
First, convert the normalized scientific notations from decimal to binary as follows:
A=3.984375*10-1 =0.3984375 = 1.*2-2 (Fill in the fraction of 10 binary bits)
B=3.4375*10-1 = 0.34375 = 1. *2-2 (Fill in the fraction of 10 binary bits)
C= 1.771*103 = 1771 = 1.*210 (Fill in the fraction of 10 binary bits)
Next, align the binary point of A and B, compute A+B, and then get the normalized scientific notations of the sum A+B = 1. *2-1 (Fill in the fraction of 10 binary bits)
Next, align the binary point of (A+B) and C, compute (A+B)+C, and then get the normalized scientific notations of the sum (A+B)+C as follows.
(A+B)+C = (0.000000000010111110000)* 210 + 1.1011101011*210 = (0.000000000010111110000 + 1.1011101011 )* 210=(1.1011101011 10 111110000)* 210 =1.1011101100* 210 (Round up to have 10-bit fraction).
So, (A+B)+C is equal to a decimal value of , and its 16-bit half precision format is (Fill in 16 binary bits).
3.33 Now calculate A + (B+C) by hand, assuming each of the values are stored in the 16-bit half precision format described in Exercise 3.27 (and also described in the text). Assume 1 guard, 1 round bit, and 1 sticky bit, and round to the nearest even. Show all the steps, and write your answer in both the 16-bit floating point format and in decimal.
A+(B+C) = 1.1001100000*2-2 + (1.0110000000*2-2 + 1.1011101011*210) =1.1001100000*2-2 + (0.00000 00000 01 0110000000*210 + 1.1011101011*210) = 1.1001100000*2-2 + (1.1011101011 01 0110000000*210) =1.1001100000*2-2 + (1.1011101011 *210 ) (Round down to 10-bit fraction). After aligning the binary point, we have A+)B+C) = 0.000000000001 1001100000*210 + (1.1011101011 *210) = (0.0000000000 01 1001100000 + 1.1011101011) *210 = (1.1011101011 01 1001100000) *210 (round down to get 10-bit fraction) = 1. *210 (10 binary bit).
So, A+(B+C) is equal to a decimal value of , and its 16-bit half precision format is (Fill in 16 binary bits)
Is (A+B)+C equal to A+(B+C) (y/n)? (Fill in either y or n)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started