A processor executes 5 classes of instructions, with the CPI for each class as g
ID: 3854691 • Letter: A
Question
A processor executes 5 classes of instructions, with the CPI for each class as given below:
Class CPI
A 1
B 2
C 2
D 3
E 5
A certain benchmark program contains these instruction classes in the ratio 5:4:3:2:1. A compiler optimization can change the ratio of the instructions to 4:3:2:2:1 while reducing the total number of instructions by 5%.
a) What is the average CPI before and after the compiler optimization?
b) By what percentage will the performance of the processor (as measured by executing the said benchmark program) go up by this optimization? (Assume the clock cycle time remains constant)
Explanation / Answer
a
Before:
5*1 + 4*2 + 3*2 + 2*3 + 1*5
= 5 + 8 + 6 + 6 + 5
= 30
AVG CPI: 30/15 = 2
After:
4*1 + 3*2 + 2*2 + 2*3 + 1*5
= 4 + 6 + 4 + 6 + 5
= 25
AVG CPI: 25/12 = 2.08
b.
The compiler is also responsible for reducing the instructions count by 5%
So before if there were x instructions total time required by the process = 2 * x
After the use of compiler, instruction count is 0.95x, and total time required = 2.08 * 0.95 * x
Speed up = (2*x) / (2.08*0.95*x)
= 1.012
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.