retagged by
543 views
2 votes
2 votes
Suppose there are $500$ memory references in which $50$ misses in the $1$st level cache and $20$ misses in the $2$nd level cache . Let the miss penalty from L2 cache to memory is $100$ cycles.

Hit time in L2 cache is $20$ cycles and hit time in L1 cache is $10$ cycles. If there are $2.5$ memory reference/instruction , average number of stall cycles per instruction will be __________
retagged by

2 Answers

Best answer
5 votes
5 votes

There are 500 memory references and there are 2.5 memory reference/instruction hence there will be
x*2.5 = 500; 
x=$ \frac{500}{2.5}$ = 200 instructions.

No. of memory stalls = Miss in L1* Miss Penalty L1 + Miss in L2* Miss Penalty L2

=50*20 + 20*100 = 1000 + 2000 = 3000 memory stall cycles

  No. of stall cycles/instruction = $ \frac{3000}{200}$ = 15
Reference: https://gateoverflow.in/21135/q26-ch-5-m_e-workbook 

Second Method:

no. of memory stalls/ memory reference: Miss in L1* MissPenaltyL1

Miss Penalty L1 = Hit Time L2 + Miss in L2*MissPenaltyL2

no. of memory stalls/memory reference =$ \frac{50}{500}*( 20 + \frac{20}{50}*100 )$ = 6

Avg. stall/ instruction = (no. of memory stalls/memory reference)*memory reference/Instruction

= 6*2.5 = 15
Hence, 15 is correct answer!

selected
3 votes
3 votes
total number of instructions (500/2.5) = 200

Number of memory stalls / instruction = ( 50 / 200 ) * 20 + (20 / 200) * 100 = 5 + 10 = 15
Answer:

Related questions