Sample-Exam1

Download Report

Transcript Sample-Exam1

UNIVERSITY OF MASSACHUSETTS
Dept. of Electrical & Computer Engineering
Digital Computer Arithmetic
ECE 666
Mid-Term I
Sample Exam
Israel Koren
ECE666/Koren Sample Mid-term 1.1
Copyright 2012 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}.
ECE666/Koren Sample Mid-term 1.2
Copyright 2012 Koren
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
ECE666/Koren Sample Mid-term 1.3
Copyright 2012 Koren
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.
ECE666/Koren Sample Mid-term 1.4
Copyright 2012 Koren
(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.
ECE666/Koren Sample Mid-term 1.5
Copyright 2012 Koren
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.
ECE666/Koren Sample Mid-term 1.6
Copyright 2012 Koren
ECE666/Koren Sample Mid-term 1.7
Copyright 2012 Koren
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.
ECE666/Koren Sample Mid-term 1.8
Copyright 2012 Koren
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.
ECE666/Koren Sample Mid-term 1.9
Copyright 2012 Koren
(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
ECE666/Koren Sample Mid-term 1.10
Copyright 2012 Koren
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.
ECE666/Koren Sample Mid-term 1.11
Copyright 2012 Koren
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?
ECE666/Koren Sample Mid-term 1.12
Copyright 2012 Koren
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?
ECE666/Koren Sample Mid-term 1.13
Copyright 2012 Koren
(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?
ECE666/Koren Sample Mid-term 1.14
Copyright 2012 Koren
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?
ECE666/Koren Sample Mid-term 1.15
Copyright 2012 Koren