Skip to content
Official PYQ · 2017

GATE CS 2017 Set 2 Q45 — Memory Hierarchy: Cache, Main Memory and Secondary Storage

Explain with AI
The read access times and the hit ratios for different caches in a memory hierarchy are as given below:
CacheRead access time (in nanoseconds)Hit ratioI-cache20.8D-cache20.9L2-cache80.9\begin{array}{|l|c|c|} \hline \text{Cache} & \text{Read access time (in nanoseconds)}& \text{Hit ratio} \\ \hline \text{I-cache} & \text{2} & \text{0.8} \\ \hline \text{D-cache} & \text{2} & \text{0.9}\\ \hline \text{L2-cache} & \text{8} & \text{0.9} \\ \hline \end{array}
The read access time of main memory in 90  nanoseconds90\;\text{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 00 for all the blocks in the caches. In execution of a program, 60%60\% of memory reads are for instruction fetch and 40%40\% are for memory operand fetch. The average read access time in nanoseconds (up to 22 decimal places) is _________
View worked solution

Answer: 4.7 : 4.8

Using the hierarchical (serial) memory access model, the average access time for a cache level is calculated as:

Tavg=TL1+(1−HL1)×[TL2+(1−HL2)×TMM]T_{\text{avg}} = T_{\text{L1}} + (1 - H_{\text{L1}}) \times \left[ T_{\text{L2}} + (1 - H_{\text{L2}}) \times T_{\text{MM}} \right]

We calculate the average read access times for instruction fetches and data fetches separately:

  • Instruction Fetch (60%60\% of reads):
    Tavg, I=2+(1−0.8)×[8+(1−0.9)×90]T_{\text{avg, I}} = 2 + (1 - 0.8) \times [8 + (1 - 0.9) \times 90] Tavg, I=2+0.2×[8+9]=2+3.4=5.4 nsT_{\text{avg, I}} = 2 + 0.2 \times [8 + 9] = 2 + 3.4 = 5.4\text{ ns}
  • Data Fetch (40%40\% of reads):
    Tavg, D=2+(1−0.9)×[8+(1−0.9)×90]T_{\text{avg, D}} = 2 + (1 - 0.9) \times [8 + (1 - 0.9) \times 90] Tavg, D=2+0.1×[8+9]=2+1.7=3.7 nsT_{\text{avg, D}} = 2 + 0.1 \times [8 + 9] = 2 + 1.7 = 3.7\text{ ns}

The overall average read access time is the weighted average of instruction and data fetches:

Tavg=0.6×Tavg, I+0.4×Tavg, DT_{\text{avg}} = 0.6 \times T_{\text{avg, I}} + 0.4 \times T_{\text{avg, D}} Tavg=0.6×5.4+0.4×3.7=3.24+1.48=4.72 nsT_{\text{avg}} = 0.6 \times 5.4 + 0.4 \times 3.7 = 3.24 + 1.48 = 4.72\text{ ns}

Thus, the average read access time is 4.72 ns.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Memory Hierarchy: Cache, Main Memory and Secondary Storage questions