Question

The read access times and the hit ratios for different caches in a memory hierarchy are as given below.

Cache Read access time (in nanoseconds) Hit ratio
I-cache 2 0.8
D-cache 2 0.9
L2-cache 8 0.9

The read access time of main memory is 90 nanoseconds. Assume that the caches use the referred-word-first read policy and the write back policy. Assume that all the caches are direct mapped caches. Assume that the dirty bit is always 0 for all the blocks in the caches. In execution of a program, 60% of memory reads are for instruction fetch and 40% are for memory operand fetch. The average read access time in nanoseconds (up to 2 decimal places) is

Official answer and solution
Official answer
4.72
From
Official GATE 2017 answer key

Solution

Compute the average read access time for instruction fetches and data fetches separately, then calculate the weighted average based on the given access percentages.

Given memory parameters:

  • I-cache: access time TI=2T_I = 2 ns, hit ratio hI=0.8  ⟹  h_I = 0.8 \implies miss rate mI=0.2m_I = 0.2
  • D-cache: access time TD=2T_D = 2 ns, hit ratio hD=0.9  ⟹  h_D = 0.9 \implies miss rate mD=0.1m_D = 0.1
  • L2-cache: access time TL2=8T_{L2} = 8 ns, hit ratio hL2=0.9  ⟹  h_{L2} = 0.9 \implies miss rate mL2=0.1m_{L2} = 0.1
  • Main memory: access time TMM=90T_{\text{MM}} = 90 ns
  • Instruction fetch proportion =60%=0.60= 60\% = 0.60
  • Data operand fetch proportion =40%=0.40= 40\% = 0.40
  1. L2 Miss Penalty: On a miss in L2 cache, main memory is accessed, taking TMM=90T_{\text{MM}} = 90 ns.
    The effective L2 access time on an L1 miss is:
    TL2,eff=TL2+mL2⋅TMM=8+0.10×90=8+9=17 nsT_{\text{L2,eff}} = T_{L2} + m_{L2} \cdot T_{\text{MM}} = 8 + 0.10 \times 90 = 8 + 9 = 17 \text{ ns}
  2. Instruction Fetch Average Access Time (TinstT_{\text{inst}}):
    Tinst=TI+mI⋅TL2,eff=2+0.20×17=2+3.4=5.4 nsT_{\text{inst}} = T_I + m_I \cdot T_{\text{L2,eff}} = 2 + 0.20 \times 17 = 2 + 3.4 = 5.4 \text{ ns}
  3. Data Fetch Average Access Time (TdataT_{\text{data}}):
    Tdata=TD+mD⋅TL2,eff=2+0.10×17=2+1.7=3.7 nsT_{\text{data}} = T_D + m_D \cdot T_{\text{L2,eff}} = 2 + 0.10 \times 17 = 2 + 1.7 = 3.7 \text{ ns}

Compute the overall weighted average read access time:

Tavg=0.60×Tinst+0.40×TdataT_{\text{avg}} = 0.60 \times T_{\text{inst}} + 0.40 \times T_{\text{data}}
=0.60×5.4+0.40×3.7=3.24+1.48=4.72 ns= 0.60 \times 5.4 + 0.40 \times 3.7 = 3.24 + 1.48 = 4.72 \text{ ns}

Thus, the average read access time is 4.72 nanoseconds.

Final answer

4.72

Common trap

Averaging the hit ratios of I-cache and D-cache directly instead of evaluating instruction and data access paths separately.

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
45 of 65, printed as CS Q.45
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.