GATE / CS ARCHIVE

SIMILAR QUESTIONS / COMPUTER ORGANIZATION & ARCHITECTURE

Weight conditional cache-hierarchy paths

4 questions solved the same way, newest first. Back to Computer Organization & Architecture

How these are solved

Weight each reached cache level by preceding miss probabilities. Distinguish cumulative path times (2025 S1) from additive penalties (2025 S2);

2 marks · NAT
Report issue

Averaging cumulative memory-access path times

Cache Memory

Question 53, GATE 2025: Memory is searched in order L1,L2,main memory. L1 has 95% hit rate and 10 ns access time. L2 has 85% hit rate conditional on an L1 miss; its 20 ns time already includes the L1 miss penalty. Main-memory access is 200 ns including both cache miss penalties. Find average access time in ns to two decimals.
Tap to enlarge
Answer & solution

Official answer: 11.83 to 11.87

Our answer: 11.85

Approach: Partition accesses into mutually exclusive completion paths and weight the total time of each path.
An L1 hit has probability 0.95 and total time 10 ns. An L1 miss followed by an L2 hit has probability 0.05×0.85=0.0425 and total time 20 ns. Missing both caches has probability 0.05×0.15=0.0075 and total time 200 ns. These probabilities sum to 1.
The expected time is therefore 0.95×10+0.0425×20+0.0075×200=9.50+0.85+1.50=11.85 ns.
The word “including” in the diagram is essential: adding 10 ns again to the L2 or memory path would double-count time already included. Likewise the 85% L2 hit rate applies only to accesses reaching L2, not to all processor requests.

Original paper, page 53 · Answer key

2 marks · NAT
Report issue

Cache Memory

Question 55, GATE 2025: A two-level cache has L1 access time 1 ns and hit rate 90%. Conditional on reaching L2, its hit rate is 80%; the L1-miss transfer/access penalty through L2 is 10 ns. An L2 miss adds 100 ns to transfer from main memory. Find average memory access time in ns, to one decimal place, using additive miss penalties.
Tap to enlarge
Answer & solution

Official answer: 4.0

Always pay the 1-ns L1 lookup. With probability 1−0.9=0.1, an L1 miss adds 10 ns for the next level. Of those L1 misses, a fraction 1−0.8=0.2 also miss L2 and incur the additional 100 ns. Therefore
AMAT=1+0.1[10+0.2·100]=1+0.1·30=4.0 ns.

An equivalent path-probability calculation makes the nesting clear. L1 hits occur with probability 0.9 and cost 1 ns. L1 miss/L2 hit occurs with probability 0.1·0.8=0.08 and costs 1+10=11 ns. Misses in both levels occur with probability 0.1·0.2=0.02 and cost 1+10+100=111 ns. Their weighted sum is 0.9·1+0.08·11+0.02·111=4.0 ns.

The L2 hit rate is conditional on an L1 miss, not a separate 80% of all requests. Also, the stated miss penalties are additional times; treating them as inclusive complete-path times would describe a different model. Answer: 4.0.

Original paper, page 43 · Answer key

2 marks · MCQ
Report issue

Cache Memory

Question 29, GATE 2017: L1 and L2 cache access times are 1 and 8 cycles. The additional L2-to-memory miss penalty is 18 cycles. The L1 miss rate is twice the L2 miss rate. Given AMAT=2 cycles, find the rates (L1,L2). A:(0.111,0.056). B:(0.056,0.111). C:(0.0892,0.1784). D:(0.1784,0.0892).
Tap to enlarge
Your answer
Answer & solution

Official answer: A

1. Let m be the local L2 miss rate, conditional on reaching L2. The L1 miss rate is 2m. Every access pays 1 cycle, an L1 miss adds 8, and an L2 miss on that path adds 18.

2. Therefore 2=1+2m(8+18m). Expanding gives 36m²+16m-1=0. The quadratic formula gives m=(-16±√400)/72, so its nonnegative root is 4/72=1/18; the other root is invalid as a probability.

3. Thus L2 misses about 0.05556 and L1 misses 1/9≈0.11111. In the requested L1,L2 order, the rounded pair is A. Treating the L2 rate as a global rate, or charging lower-level time on every hit, would give a different model.

Original paper, page 11 · Answer key

2 marks · NAT
Report issue

Cache Memory

Question 45, GATE 2017: I-cache read time/hit ratio:2 ns/0.8; D-cache:2 ns/0.9; shared L2:8 ns/0.9. Main-memory read time is 90 ns. Caches are direct mapped, use referred-word-first and write-back, and every dirty bit is 0. Of reads,60% fetch instructions and 40% fetch operands. Find average read time in ns to two decimals.
Tap to enlarge
Answer & solution

Official answer: 4.72

1. Compute the chance of reaching L2 by weighting the two L1 miss rates: 0.6(1-0.8)+0.4(1-0.9)=0.12+0.04=0.16. Every read first pays the 2 ns L1 lookup.

2. Conditional on an L1 miss, the L2 lookup adds 8 ns. Its local miss probability is 0.1, and such a miss adds 90 ns for memory. The expected additional time on an L1 miss is therefore 8+0.1·90=17 ns.

3. AMAT=2+0.16·17=4.72 ns. As a separate check, instruction reads average 2+0.2·17=5.4 ns and data reads 2+0.1·17=3.7 ns; 0.6·5.4+0.4·3.7=4.72. Clean blocks eliminate dirty write-back penalties, and referred-word-first permits the demanded read to finish without waiting for an unspecified whole-block transfer.

Original paper, page 18 · Answer key