Last Updated : 26 Dec, 2018

Consider a two-level cache memory L1, L2:

Cache Hit rate access time
L1 X 2 ns
L2 Y 5 ns


Main memory access time is 12 ns. The average memory access time of this architecture is 6 ns. Miss rate of L2 is half of L1. What will be the value of (X – Y)?

(A) 0.75
(B) 0.5
(C) 0.25
(D) None of these.


Answer: (C)

Explanation: Average memory access time = access time of L1 + Miss rate of L1 * Miss penality of L1
Miss penality of L1 = Access time of L2 + Miss rate of L2 * Miss penality of L2
Let miss rate of L2 = M ;
Then Let miss rate of L1 = 2M
Miss penality of L1 = 5 ns + M * 12 ns
= 5 ns + M * 12 ns
Average memory access time = access time of L1 + Miss rate of L1 * Miss penality of L1
6 ns = 2 ns + 2M * (5 ns + M * 12 ns )
On solving this equation:
M = 1 / 4, -2 / 3
M(Miss rate of L2) = 1 / 4 (rejecting negative rate)
2M(Miss rate of L1) = 1 / 2
Since 1 – miss rate = hit rate
Y = 1 – 1/4 = 3/ 4
Similarly X = 1 – 1/2 = 1/2
X – Y = 1/4
So, option (C) is correct.


Quiz of this Question


Share your thoughts in the comments