Question

In a two-level cache system, the access times of L1L_1 and L2L_2 caches are 1 and 8 clock cycles, respectively. The miss penalty from the L2L_2 cache to main memory is 18 clock cycles. The miss rate of L1L_1 cache is twice that of L2L_2. The average memory access time (AMAT) of this cache system is 2 cycles. The miss rates of L1L_1 and L2L_2 respectively are:

Choose one option
Official answer and solution
Official answer
A
From
Official GATE 2017 answer key

Solution

Set up the Average Memory Access Time (AMAT) formula for a two-level cache hierarchy and solve the resulting quadratic equation for the miss rates.

Let m1m_1 and m2m_2 denote the local miss rates of the L1L_1 and L2L_2 caches, respectively.
Given:

  • L1L_1 hit access time T1=1T_1 = 1 clock cycle
  • L2L_2 hit access time T2=8T_2 = 8 clock cycles
  • Miss penalty from L2L_2 to main memory TMM=18T_{\text{MM}} = 18 clock cycles
  • m1=2m2  ⟹  m2=m12m_1 = 2m_2 \implies m_2 = \frac{m_1}{2}
  • AMAT=2\text{AMAT} = 2 clock cycles

The AMAT for a two-level cache system is:

AMAT=T1+m1(T2+m2⋅TMM)\text{AMAT} = T_1 + m_1 \left( T_2 + m_2 \cdot T_{\text{MM}} \right)

Substitute the given values:

2=1+m1(8+18m2)2 = 1 + m_1 \left( 8 + 18 m_2 \right)
1=m1(8+18⋅m12)=m1(8+9m1)1 = m_1 \left( 8 + 18 \cdot \frac{m_1}{2} \right) = m_1 \left( 8 + 9m_1 \right)
9m12+8m1−1=09m_1^2 + 8m_1 - 1 = 0

Factor the quadratic equation:

(9m1−1)(m1+1)=0(9m_1 - 1)(m_1 + 1) = 0

Since miss rate must be positive, m1=19≈0.111m_1 = \frac{1}{9} \approx 0.111.
Then m2=m12=118≈0.0556≈0.056m_2 = \frac{m_1}{2} = \frac{1}{18} \approx 0.0556 \approx 0.056.

Therefore, the miss rates of L1L_1 and L2L_2 are 0.111 and 0.056 respectively, which matches option A.

Final answer

A

Common trap

Using global miss rate instead of local miss rate for L2L_2, or inverting the relation between m1m_1 and m2m_2.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2017 Computer Science and Information Technology (CS) Session 2
Question
29 of 65, printed as CS Q.29
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.