Computer Science 152 - Fall 1999 - Kubiatowicz - Midterm 1

Computer Science 152 - Fall 1999 - Kubiatowicz - Midterm 1...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
1 University of California, Berkeley College of Engineering Computer Science Division EECS Fall 1999 John Kubiatowicz Midterm I SOLUTIONS October 6, 1999 CS152 Computer Architecture and Engineering Your Name: SID Number: Discussion Section: Problem Possible Score 12 0 21 5 33 5 43 0 Total
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2 Problem 1: Performance Problem 1a: Name the three principle components of runtime that we discussed in class. How do they combine to yield runtime? Three components: Instruction Count, CPI, and Clock Period (or Rate) Rate Clock CPI Count Inst period Clock CPI Count Inst Runtime × = × × = Problem 1b: What is Amdahl’s law for speedup? State as a formula which includes a factor for clock rate. × + = = old Freq new Freq ) 1 ( 1 new Time old Time Speedup n f f Where f = fraction of cycles sped up by optimization, n is the speedup. Let us suppose that you have been running an important program on your company’s 300MHz Acme II processor. By running a detailed simulator, you were able to collect the following instruction mix and breakdown of costs for ezach instruction type: Instruction Class Frequency (%) Cycles Integer arithmetic and logical 40 1 Load 20 1 Store 10 2 Branches 20 3 Floating Point 10 5 Problem 1c : What is the CPI and MIPS rating of the Acme II for this program? CPI = .4(1)+.2(1)+.1(2)+.2(3)+.1(5) = 1.9 MIPS = 300/1.9 = 157.9 Problem 1d: Suppose that you turn on the optimizer and it eliminates 30% of the arithmetic/logic instructions (i.e. 12% of the total instructions), 30% of load instructions, and 20% of the floating-point instructions. None of the other instructions are effected. What is the speedup of the optimized program? (Be sure to state the formula that you are using for speedup and show your work) The easiest way to compute this is to imagine that the original program had 100 instructions in it. Then, we can compute the number of cycles for the optimized version of this program vs the original: [] 17 . 1 62 . 1 9 . 1 ) 5 ( 02 . ) 1 ( 06 . ) 1 ( 12 . 9 . 1 100 9 . 1 100 new Time old Time = = + × × = = Speedup
Background image of page 2
3 Problem 1e: What is the CPI and MIPS rating with the optimized version of the program? Compare your result to that of (1c) and explain the difference: Our optimizer removed .12+.06+.02 = .2 of our instructions. That means that we need to rescale by 1/(1-0.2) = 1/0.8. You could imagine that the new table is: Instruction Class Frequency (%) Cycles Integer arithmetic and logical 35 8 . 0 ) 3 . 0 1 ( 40 = 1 Load 5 . 17 8 . 0 ) 3 . 0 1 ( 20 = 1 Store 5 . 12 8 . 0 10 = 2 Branches 25 8 . 0 20 = 3 Floating Point 10 8 . 0 ) 2 . 0 1 ( 10 = 5 Practically speaking, we have already done most of the required computation in the last problem: CPI = 1.62/0.8= 2.025, MIPS= 300/2.025 = 148.1 These numbers seem to reflect worse performance (higher CPI / lower MIPS) since the optimizer removed more fast instructions than slow ones. However, the program will run faster, since it has only 80% of the instructions of the original.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 16

Computer Science 152 - Fall 1999 - Kubiatowicz - Midterm 1...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online