# Calculating Cpi with Miss Rate

In my assignment I have the following question:

The processor has a clock rate of 1 GHZ. The miss rate in the instruction cache is 1.5%. The miss rate in the data cache is 4%. 30% of the instruction access the data. The miss time for the data and instructions is 70ns.

A. Assuming we don't have any more stalls, what is the CPI of this processor? B. I have to choose between two options: 1. Use a processor with 2 GHZ while the cache stays the same. 2. Use a better cache, which in it the miss time for data and instructions go down to 35 ns, while the clock rate remains 1 GHZ.

Which improvement is better?

What I don't understand here, is how can I calculate the CPI if I don't have the base cpi?

Let's assume the base cpi is X, then the memory stalls as I thought is:

4%*30%*70+1.5%*70=1.89


So the CPI is:

1.89 + X


What am I missing? is it possible to calculate A part as a number?

And for part B, how does the improvement in GHZ affects the performance? What I know is that if we improve the clock rate, the miss penalty goes up

*We don't have to take into account the hit time, for this question.

• You have percentages. Why not multiply up by a known factor (say 1,000) and use the standard CPI formulae for a 1,000 instruction program? en.wikipedia.org/wiki/Cycles_per_instruction Commented Sep 21, 2014 at 17:34