5,672 views
1 votes
1 votes
Consider a two level cache system. For 100 memory references 20 misses in 1st level cache,10 misses in second level cache. Miss penalty from second level to memory is 40 cycles. if Total average = 7.6 cycles, then hit time of second level cache ? Assume hit time of second level cache is two times the first level cache?

Ans. 4

2 Answers

2 votes
2 votes

https://gateoverflow.in/?qa=blob&qa_blobid=11423634474127333130

In this from slide 17 gives AMAT for a 2-level cache.

Let L1 cache access time=x cycles

Then L2 cache access time=2x cycles.

100 references to L1 cache, out of which 20 missed, $Missrate_{L1}=\frac{20}{100}=0.2$

These 20 misses of L1 cache are looked into L2 cache of which 10 misses occur in L2.

So $Missrate_{L2}(Local\,Miss\,Rate)=\frac{10}{20}=0.5$

$Global\,Miss\,Rate_{L2}=\frac{10}{100}=0.1$

Assuming Local miss rate of L2, goes below calculation.

$Misspenalty_{L1}=Hit\,Time_{L2}+(Miss\,rate_{L2} \times Miss\,Penalty_{L2})=2x+(0.5 \times 40)=2x+20$

$AMAT=Hit\,Time_{L1}+(Miss\,rate_{L1} \times Miss\,Penalty_{L1})$

$7.6=x+0.2(2x+20)$

$7.6=1.4x+4$

$x=2.57$

Since $x$ is the L1 cache access time in cycles, number of cycles must be integral, so it has taken 2 cycles plus 0.57 of another cycle so appx 3 cycles.

So, Access time L2=6 cycles.

Let me know if there is something wrong here.

0 votes
0 votes
Let the hit time of first level (L1) be x cycle, then hit time of second level (L2)  will be 2x cycle.

AMAT =  L1 access time + L1 miss rate X L2 access time

+ L1 miss rate  X L2 miss rate X Memory access time.

7.6= x + (20/100) * (2x) + (20/100) * (10/20) *  40

x=2.571

we take floor of (2.571)

then x=3 clock cycle

second level time=6 clock cycle.

Related questions

0 votes
0 votes
2 answers
1
rahuldb asked Nov 10, 2016
2,987 views
In a two level hierarchy if the top level has an access time of 8ns and the bottom level has an access time of 60 ns. What is the hit ratio in top level required to give ...
0 votes
0 votes
3 answers
3
Satyajeet Singh asked Jun 14, 2017
479 views
On a system with 32 bit addresses and 4KB pages, how many levels are required in multilevel page table (assume that each entry in the page table takes 4 bytes of storage)...