Skip to content

GATE CS 1992 Q5-a — Memory Hierarchy: Cache, Main Memory and Secondary Storage

Explain with AI
The access times of the main memory and the Cache memory, in a computer system, are 500500 n sec and 5050 nsec, respectively. It is estimated that 80%80\% of the main memory request are for read the rest for write. The hit ratio for the read access only is 0.90.9 and a write-through policy (where both main and cache memories are updated simultaneously) is used. Determine the average time of the main memory (in ns).
View worked solution

Answer: 180

We are given the following parameters:

  • Cache memory access time (TcT_c) = 50 ns50\text{ ns}
  • Main memory access time (TmT_m) = 500 ns500\text{ ns}
  • Read request fraction (freadf_{\text{read}}) = 0.800.80
  • Write request fraction (fwritef_{\text{write}}) = 0.200.20
  • Read hit ratio (hh) = 0.90.9

Step 1: Calculate the average read access time (TreadT_{\text{read}})

On a read hit, only the cache is accessed. On a read miss, the cache is accessed first, followed by the main memory:

Tread=h⋅Tc+(1−h)⋅(Tc+Tm)T_{\text{read}} = h \cdot T_c + (1 - h) \cdot (T_c + T_m) Tread=0.9×50+0.1×(50+500)=45+55=100 nsT_{\text{read}} = 0.9 \times 50 + 0.1 \times (50 + 500) = 45 + 55 = 100\text{ ns}

Step 2: Calculate the write access time (TwriteT_{\text{write}})

With a write-through policy where both the cache and main memory are updated simultaneously, the write time is determined by the slower main memory:

Twrite=Tm=500 nsT_{\text{write}} = T_m = 500\text{ ns}

Step 3: Calculate the overall average memory access time (TavgT_{\text{avg}})

Tavg=fread⋅Tread+fwrite⋅TwriteT_{\text{avg}} = f_{\text{read}} \cdot T_{\text{read}} + f_{\text{write}} \cdot T_{\text{write}} Tavg=0.8×100+0.2×500=80+100=180 nsT_{\text{avg}} = 0.8 \times 100 + 0.2 \times 500 = 80 + 100 = 180\text{ 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