GATE 2020 CS – Question 31
A direct mapped cache memory of 1 MB has a block size of 256 bytes. The cache has an access time of 3 ns and a hit rate of 94%. During a cache miss, it takes 20 ns to bring the first word of a block from the main memory, while each subsequent word takes 5 ns. The word size is 64 bits. The average memory access time in ns (round off to 1 decimal place) is ______.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: 13.3 to 13.5
Explanation
Block size 256 bytes and word size 64 bits $=8$ bytes, so a block has $256/8=32$ words.
**Miss penalty:** the first word takes 20 ns and each of the other 31 words takes 5 ns:
$$20+31\times5=175\text{ ns}.$$
**Average memory access time** (hit time 3 ns, hit rate 94%):
$$\text{AMAT}=0.94\times3+0.06\times175=2.82+10.5=13.32\approx\mathbf{13.3}\text{ ns}.$$
(If the 3 ns cache access is also charged on a miss, i.e. $3+0.06\times175=13.5$ ns. The official key accepted both 13.3 and 13.5.)