GATE / CS ARCHIVE

GATE CSE 2020 / QUESTION 21

GATE CSE 2020 Q21

Computer Organization & Architecture · Cache Memory · Full GATE CSE 2020 paper

GATE 2020, Q21 1 mark · NAT
Report issue

Cache Memory

Question 21, GATE 2020: A 1 MB direct-mapped cache has 256-byte blocks, access time 3 ns, hit rate 94%, and 64-bit words. On a miss, main memory delivers the first word in 20 ns and every subsequent word in 5 ns. Find average access time to one decimal place. Official scoring accepts 13.3 or 13.5 ns as separate values.
Tap to enlarge
Answer & solution

Official answer: 13.3 OR 13.5

Our answer: 13.5 or 13.3 under the two accepted timing conventions

Worked explanation

Convert the word size first: 64 bits is 8 bytes. A block therefore contains 32 words, and the first-word latency is paid once, followed by 31 further transfers, giving 20+31×5=175 ns. Miss probability is 1−0.94=0.06. If the 175 ns is an extra miss penalty after lookup, every reference pays 3 ns and 6% pay the extra penalty. If it is the entire miss-path time instead, only the hit branch uses the separate 3 ns figure in a weighted average. These conventions produce the two official answers already preserved below. The 1 MB capacity and direct mapping are not needed once the hit rate is given. No early-restart timing is specified, so use a full refill.

Derivation and answer

Each block holds 256/8=32 words. A complete refill takes 20+31·5=175 ns. If a miss incurs the 3 ns cache lookup before refill, AMAT=3+0.06·175=13.5 ns. If the 175 ns miss time is treated as the total miss-service time, the weighted average is 0.94·3+0.06·175=13.32 ns, rounding to 13.3. The official key explicitly accepts both 13.3 and 13.5; neither is silently discarded. Both calculations assume full-block service without critical-word early restart.

Original paper, page 8 · Answer key