150 likes | 344 Views
UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering Digital Computer Arithmetic ECE 666 Mid-Term I Sample Exam. Israel Koren. 1. (a) Multiply the following two SD numbers 010bar{1}1 and 00bar{1}01. Perform all intermediate steps in SD arithmetic.
E N D
UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer EngineeringDigital Computer Arithmetic ECE 666Mid-Term ISample Exam Israel Koren
1. (a) Multiply the following two SD numbers 010\bar{1}1 and 00\bar{1}01. Perform all intermediate steps in SD arithmetic. (b) (10 points) Find the minimal representation of the following SD number: 01110\bar{1}\bar{1}\bar{1}.
2. (a) Show the result (in hexadecimal) of the following multiplication in the IEEE short format (the operands are given in hexadecimal notation), in all four rounding schemes (round-to-nearest-even, round toward zero, round toward and - ): 4400 2000 x C300 0200. (b) Show the result (in hexadecimal) of the following addition in the IEEE short format in all four rounding schemes. The operands are given in the hexadecimal notation: 6380 0000 + D7C0 0007
3. In an attempt to reduce the expected error in the computation A1 (A2-A3) it has been suggested to calculate instead A1 A2- A1 A3. Compare the relative error accumulated in these two calculations assuming that each of the three operands is a result of a previous calculation and has a relative error of _i (i=1,2,3), i.e., Ai=Ai^c (1+ _i), where Ai^c is the correct value of Ai. Also assume that the multiply and subtract operations introduce relative errors of _m and _s, respectively (e.g., Fl(x y)=(x y)(1+ _m)). (a) Write expressions for the relative errors of the results of A1 (A2-A3) and A1 A2 - A1 A3.
(b) Compare the two relative errors for the case A1=1000A3, A2=1.01A3 and _1= _2= _3. Which calculation will result in a higher accumulated error if _s = 2 _m? Explain.
4. Convert the number (011011)_{-2} to radix 2 and the number (001011)_2 to radix -2. Describe a procedure for converting numbers from radix r to -r and vice versa. Illustrate your procedure by converting (321)_10 to radix -10.
1. Show the exact steps in the non-restoring division with the (negative) dividend X=1011001 in two's complement representation and the divisor D=0110.
2. (a) Show the representation of the following operands in the IEEE short format (use hexadecimal notation), perform the multiplication and show the final result in all four rounding schemes (nearest-even, toward zero (truncate), toward +, and toward -). (1+2^{-23}) (1+2^{-22}). Note: (1+2^{-23}) is the number 1.00000000000000000000001.
(b) Show the result of the following subtraction of numbers in the IEEE short format in all four rounding schemes. The operands are already given in the hexadecimal notation. 3F80 0000 - 3EFF FFFF
3. (4.10) Write down the post-normalization steps that might be needed when performing addition, subtraction, multiplication, and division with two floating-point operands in the IEEE short format. Indicate how many guard digits are needed in each case.
4. Prove that the optimal way to implement a two-level combinatorial shifter for k bits, where k=m^2, is for the first level to shift by multiples of m, and the second level to shift from 0 to m. Assume that the speed is proportional to the number of destinations for each line in the two levels. Can you generalize this result for any value of k?
5. (4.12) Two normalized floating-point numbers A and B in the short IEEE format were added, and the result was equal to A. Does this imply that B=0?
(b) (4.13) Given a floating-point number A with an exponent E_A (in any format), its successor has either the same exponent or the exponent E_A+1. Is the distance between A and its successor the same in both cases?
6. (4.14) (a) Compare the error involved in the serial evaluation of the product of four numbers, performed as (((A_1 A_2) A_3) A_4) to that of its parallel evaluation performed as ((A_1 A_2) (A_3 A_4)). Decide whether one of these methods has a smaller upper bound for the error when forming the product of n numbers. (b) Repeat (a) for the sum of four numbers, then n numbers. Can we get lower error bounds if we know that the numbers are in some order; e.g., ascending order?