fa99 midterm1 solution

# Computer Organization and Design: The Hardware/Software Interface

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

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 1 20 2 15 3 35 4 30 Total

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

View Full Document
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
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.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern