56.2k views
5 votes
Given this instruction mix and the assumption that an arithmetic instruction requires 2 cycles, a load/store instruction takes 6 cycles, and a branch instruction takes 3 cycles, find the average CPI.

User Sjlewis
by
4.2k points

1 Answer

5 votes

Answer:

2.6

Step-by-step explanation:

I am assuming that for any given program, that 70% of it's executed instructions happen to be arithmetic, another 10% happen to be load/store, and finally, a 20% happen to be branch. If so, then I can say

Average CPI =

3Σi=1 Percentage of instructions * CPI

Average CPI = (0.7 * 2) + (0.1 * 6) + (0.2 * 3)

Average CPI = 1.4 + 0.6 + 0.6

Average CPI = 2.6

User Shivam Singh
by
4.8k points