(a) What is the average number of cycles per instruction (CPI) for each program?
ID: 2072984 • Letter: #
Question
(a) What is the average number of cycles per instruction (CPI) for each program?
(b) Which program completes execution earlier?
(c) When you compare two programs is it always true that the program with the better CPI has the faster execution time? Explain.
(d) Let us say that we have the freedom to change the clock period of microprocessor M without affecting any entries in the table above. Let the execution time of P1, executed at a clock frequency of 1.5 GHz, be T units. At what clock speed should P2 be executed to ensure that it is also completed in exactly T units?
Explanation / Answer
(a) The average number of cycles per instruction (CPI) for P1=[(2000*2)+(3000*1)+(4000*3)+(3000*4)]/[2000+3000+4000+3000]=31000/12000=2.58
The average number of cycles per instruction (CPI) for P2=[(4000*2)+(2000*1)+(4000*3)+(3000*4)]/[2000+3000+4000+3000]=34000/13000=2.61
(b) Program 1 completes execution earlier because it requires less number of cycles(31000) compared to program 2(34000)
(c) Better CPI means lowest CPI. Lowest CPI requires less number of cycles so lowest CPI has faster execution time.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.