in CO and Architecture edited by
2,387 views
1 vote
1 vote

A given program has $25 \%$ load/store instructions. Suppose the ideal $\text{CPI}$ (cycles per instruction) without any memory stalls is $2$. The program exhibits $2 \%$ miss rate on instruction cache and $8 \%$ miss rate on data cache. The miss penalty is $100$ cycles. The speedup (rounded off to two decimal places) achieved with a perfect cache (i.e., with NO data or instruction cache misses) is __________.

in CO and Architecture edited by
by
2.4k views

2 Answers

2 votes
2 votes

Answer : 3

Let's Assume there are 100 instructions, 

so we have 100 fetches for 100 instructions, this will come from instruction cache. 

25% that is 25 instructions are Data fetch / store instructions - come from data cache

so in total 100 fetches we will have 2% ie, 2 misses - 200 cycles penality. 

from the data stream, 8% ie, 2 misses - 200  cycles penality. 

Total cycles taken to execute 100 instructions is 100*2 + 200 + 200 = 600 cycles

CPI = 600/100 = 6. 

In a perfect caching solution we have 0 misses and hence the CPI will be default ie, 2 CPI. 

Speedup achieved = 6/2 = 3 

1 vote
1 vote
CPI with a Perfect Cache: $2$

CPI with the Actual Cache: 2 (ideally) + $0.02 \times 100$ (stall cycles for instruction cache miss) + $0.25 \times 0.08 \times 100$ (stall cycles for data cache miss) = $6$

Speedup with a perfect cache = $6/2 = 3.$
Answer:

Related questions