This question has been answered and I just need more calification on the steps,
ID: 3705812 • Letter: T
Question
This question has been answered and I just need more calification on the steps, thank you in advance.
Consider a program that can execute with no stalls and a CPI of 1 if the underlying processor can somehow magically service every load instruction with a 1-cycle L1 cache hit. In practice, 5% of all load instructions suffer from an L1 cache miss, 2% of all load instructions suffer from an L2 cache miss, and 1% of all load instructions suffer from an L3 cache miss (and are serviced by the memory system). An L1 cache miss stalls the processor for 10 cycles while the L2 is looked up. An L2 cache miss stalls the processor for 20 cycles while the L3 is looked up. An L3 cache miss stalls the processor for an additional 300 cycles while data is fetched from memory. What is the CPI for this program if 30% of the program's instructions are load instructions?
Explanation / Answer
Solution:
Note: Actually the question was answered by me. I have made some changes and added more explanation to help you understand.
The CPI will be
The cycle taken by L1 in case of hit is = 1
hit rate for L1= 0.95
The cycle taken by L2 in case of hit is = 10
hit rate for L2= 0.98
The cycle taken by L1 in case of hit is = 20
hit rate for L1= 0.99
penalty for L1 cache miss, L2 miss, L3 miss/ Memory access time=300 cycles
percentage of load instructions=30%=0.3
Rest of instructions =70%= 0.7
CPI= L1 cache hit rate* L1 cycle Time +L1 miss rate* (L2 hit rate * (L2 cycle time+ L1 cycle time) + L2 miss rate * (L3 hit rate * L3 cycle time + L3 miss rate * (L3 cycle time + L2 cycle time+ L1 cycle time + main memory access time)))
= 0.9*1 + 0.1*(0.98 * (1+10) + 0.02*(0.99*(1+10+20) + 0.01*(1+10+20+300)) = 2.046
The above calcuation is according to that 100 5 instructions are load instrutions
so now for 30% CPI will be=> CPI=0.3 * 2.046
The effective CPI= 0.6138
I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.