Skip to content

GATE CS 1996 Q26 — Memory Hierarchy: Cache, Main Memory and Secondary Storage

Explain with AI

A computer system has a three-level memory hierarchy, with access time and hit ratios as shown below:

SizeHit ratio8M bytes0.8016M bytes0.9064M bytes0.95Level 1 (Cache memory)Access time = 50nsec/byteSizeHit ratio4M bytes0.9816M bytes0.9964M bytes0.995Level 2 (Main memory)Access time = 200nsec/byteSizeHit ratio260M bytes1.0Level 3Access time = 5μsec/byte\overset{ \text{Level $1$ (Cache memory)} \\ \text{Access time = $50 nsec/byte$}}{\begin{array}{|l|l|} \hline \textbf{Size} & \textbf{Hit ratio} \\ \hline \text{$8 M $ bytes} & \text{$0.80$} \\ \hline \text{$16 M $ bytes} & \text{$0.90$} \\ \hline \text{$64 M $ bytes} & \text{$0.95$} \\ \hline \end{array}} \quad \overset{\text{Level $2$ (Main memory)} \\ \text{Access time = $200 nsec/byte$}}{\begin{array}{|l|l|l|} \hline \textbf{Size} & \textbf{Hit ratio} \\ \hline \text{$4 M$ bytes} & \text{$0.98$} \\ \hline \text{$16 M$ bytes} & \text{$0.99$} \\ \hline \text{$64 M$ bytes} & \text{$0.995$} \\ \hline \end{array}} \quad \overset{ \text{Level $3$} \\ \text{Access time = $5$} \mu \text{sec/byte}}{\begin{array}{|l|l|l|} \hline \textbf{Size} & \textbf{Hit ratio} \\ \hline \text{$260M$ bytes} & \text{$1.0$} \\ \hline\end{array}}

  1. What should be the minimum sizes of level 11 and 22 memories to achieve an average access time of less than 100nsec100 nsec?

  2. What is the average access time achieved using the chosen sizes of level 11 and level 22 memories?

View worked solution

Answer: 61.25

For a three-level hierarchical memory system, the average access time (TavgT_{\text{avg}}) is calculated as:

Tavg=T1+(1−H1)[T2+(1−H2)T3]T_{\text{avg}} = T_1 + (1 - H_1) \left[ T_2 + (1 - H_2) T_3 \right]

Given parameters:

  • T1=50 nsecT_1 = 50 \text{ nsec}
  • T2=200 nsecT_2 = 200 \text{ nsec}
  • T3=5μsec=5000 nsecT_3 = 5 \mu\text{sec} = 5000 \text{ nsec}

Part (A): Minimum sizes to achieve Tavg<100 nsecT_{\text{avg}} < 100 \text{ nsec}

Let's evaluate different combinations of Level 1 and Level 2 sizes:

  1. L1 = 8M (H1=0.80H_1 = 0.80), L2 = 4M (H2=0.98H_2 = 0.98): Tavg=50+0.20×[200+0.02×5000]=50+0.20×300=110 nsec(≥100)T_{\text{avg}} = 50 + 0.20 \times [200 + 0.02 \times 5000] = 50 + 0.20 \times 300 = 110 \text{ nsec} \quad (\ge 100)
  2. L1 = 8M (H1=0.80H_1 = 0.80), L2 = 16M (H2=0.99H_2 = 0.99): Tavg=50+0.20×[200+0.01×5000]=50+0.20×250=100 nsec(≥100)T_{\text{avg}} = 50 + 0.20 \times [200 + 0.01 \times 5000] = 50 + 0.20 \times 250 = 100 \text{ nsec} \quad (\ge 100)
  3. L1 = 8M (H1=0.80H_1 = 0.80), L2 = 64M (H2=0.995H_2 = 0.995): Tavg=50+0.20×[200+0.005×5000]=50+0.20×225=95 nsec<100T_{\text{avg}} = 50 + 0.20 \times [200 + 0.005 \times 5000] = 50 + 0.20 \times 225 = 95 \text{ nsec} < 100
  4. L1 = 16M (H1=0.90H_1 = 0.90), L2 = 4M (H2=0.98H_2 = 0.98): Tavg=50+0.10×[200+0.02×5000]=50+0.10×300=80 nsec<100T_{\text{avg}} = 50 + 0.10 \times [200 + 0.02 \times 5000] = 50 + 0.10 \times 300 = 80 \text{ nsec} < 100

Comparing the total memory capacity of valid configurations, L1=16M\text{L1} = 16\text{M} and L2=4M\text{L2} = 4\text{M} (total 20M20\text{M}) is smaller than L1=8M\text{L1} = 8\text{M} and L2=64M\text{L2} = 64\text{M} (total 72M72\text{M}). Thus, the minimum sizes are L1 = 16M and L2 = 4M.

Part (B): Average access time for the chosen configuration

If we choose the maximum configuration of L1 = 64M (H1=0.95H_1 = 0.95) and L2 = 64M (H2=0.995H_2 = 0.995) to achieve the best possible performance:

Tavg=50+(1−0.95)×[200+(1−0.995)×5000]T_{\text{avg}} = 50 + (1 - 0.95) \times [200 + (1 - 0.995) \times 5000] Tavg=50+0.05×[200+0.005×5000]T_{\text{avg}} = 50 + 0.05 \times [200 + 0.005 \times 5000] Tavg=50+0.05×[200+25]T_{\text{avg}} = 50 + 0.05 \times [200 + 25] Tavg=50+0.05×225=50+11.25=61.25 nsecT_{\text{avg}} = 50 + 0.05 \times 225 = 50 + 11.25 = 61.25 \text{ nsec}

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