Professional Documents
Culture Documents
Exam 2 Review Answers
Exam 2 Review Answers
Exam 2 Review Answers
Exam overview:
20 questions
same reference sheets as Exam 1
yes: cheat sheet
Study:
functionality and roles of the compiler, linker, assembler, and loader
convert a simple real number to IEEE single-precision format (format
diagram given)
convert an IEEE single-precision hex representation to a real number
understand basic floating-point instructions as presented in examples in the
PowerPoint
computer performance questions (see below)
coding problems (supply missing line of code and/or describe what code
does)
break down MIPS instructions R, I, J type and explain the components
Amdahls law:
Taf f ected
Timprov ed Tunaf f ected
improvemen t factor
1. (Amdahls law question) Suppose you have a machine which executes a program
consisting of 50% floating point multiply, 20% floating point divide, and the remaining
30% are from other instructions.
(a) Management wants the machine to run faster. You can make the divide run at most 3
times faster and the multiply run at most 8 times faster. If you could make only one
improvement, which one would you choose?
(b) If you make both the multiply and divide improvements, what is the speed of the
improved machine? What is the speed relative to the original machine?
2. Computer A has an overall CPI of 1.3 and can be run at a clock rate of 600MHz.
Computer B has a CPI of 2.5 and can be run at a clock rate of 750 Mhz. We have a
particular program we wish to run. When compiled for computer A, this program
has exactly 100,000 instructions. When compiled for Computer B, the program has
60,000 instructions. Which computer will execute the program faster?
3. A benchmark was run on a CPU at 2.66 GHz. The program executed the 2.389E12
instructions in 750 s.
(a) What is the CPI?
(b) Another CPU running at 1.8 GHz compiled the program into 1.2E12 instructions.
If its CPI is .9, will it run faster or slower that the computer in (a)?
(a) Calculate the execution time is calculated for these two programs. Did you get
the same answer as the table? Why or why not?
perl = 2118E9 * 0.75 * 0.4E-9 = 635