IAE Academy

GATE 2025 CS1 Q.53: solution and answer

GATE 2025 · CS1Q.53 · 2 marks · NAT

A computer has a memory hierarchy consisting of two-level cache (L1 and L2) and a main memory. If the processor needs to access data from memory, it first looks into L1 cache. If the data is not found in L1 cache, it goes to L2 cache. If it fails to get the data from L2 cache, it goes to main memory, where the data is definitely available. Hit rates and access times of various memory units are shown in the figure. The average memory access time in nanoseconds (ns) is ________. (rounded off to two decimal places)

GATE 2025 CS1 question 53: A top-down flowchart: Processor → L1 cache (Hit rate = 95%, Access time = 10 ns) → L2 cache (Hit rate = 85%, Access time…Tap to open full size
Figure from the GATE 2025 CS1 paper. It is part of the question.
Figure description

A top-down flowchart: Processor → L1 cache (Hit rate = 95%, Access time = 10 ns) → L2 cache (Hit rate = 85%, Access time including L1 cache miss penalty = 20 ns) → Main Memory (Access time including L1 and L2 cache miss penalty = 200 ns). Each stage is a box connected by a downward arrow to the next, indicating the access path on a miss at the previous level.

Answer and solution

ANSWER

The average memory access time (AMAT) is 11.85 ns.

Official answer: 11.83 to 11.87Source: Official answer key, GATE 2025 CS1 (IIT Roorkee)

  1. Identify the three mutually exclusive, exhaustive access outcomes from the figure: (i) L1 hit, (ii) L1 miss followed by L2 hit, (iii) L1 miss followed by L2 miss (data found in main memory).

  2. P(L1 hit) = 0.95, with access time 10 ns (as stated for L1).

  3. P(L1 miss and L2 hit) = 0.05 × 0.85 = 0.0425. Its access time is 20 ns, which the figure states already includes the L1 miss penalty, so this 20 ns is used directly without adding the L1 access time again.

  4. P(L1 miss and L2 miss) = 0.05 × 0.15 = 0.0075. Its access time is 200 ns, which the figure states already includes both the L1 and L2 miss penalties, so this 200 ns is used directly.

  5. Check: 0.95 + 0.0425 + 0.0075 = 1.0, confirming the three cases are exhaustive.

  6. AMAT = 0.95 × 10 + 0.0425 × 20 + 0.0075 × 200 = 9.5 + 0.85 + 1.5 = 11.85 ns.

KEY IDEA

When a figure gives each level's access time as "including the miss penalty of the level(s) above," those numbers are already the total time incurred once that level is reached — so AMAT is simply the probability-weighted sum of the three mutually exclusive, exhaustive outcomes (L1 hit; L1 miss & L2 hit; L1 miss & L2 miss), using each stated time directly with no separate addition of the upstream access time.

WATCH OUT FOR

Adding a fresh L1-access-time term (10 ns) on top of the already-inclusive L2 and main-memory figures — e.g. computing 0.95×10 + 0.05×0.85×(10+20) + 0.05×0.15×(10+200) — which double-counts the L1 access time, since the figure explicitly states the L2 and main-memory times already include the penalty of the level(s) above missing.

From the GATE 2025 CS1 paper. Every question of this paper · Download the full paper · All 22 Memory & cache questions, with notes

More Memory & cache questions