Question

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 _______.

Official answer and solution
Official answer
13.5
From
Official GATE 2020 answer key

Solution

Compute the miss penalty by summing the time for the first word and subsequent words of the block, then apply the AMAT formula.

Given parameters:

  • Cache hit time Tcache=3 nsT_{\text{cache}} = 3\text{ ns}
  • Hit rate H=94%=0.94  ⟹  H = 94\% = 0.94 \implies Miss rate M=1−0.94=0.06M = 1 - 0.94 = 0.06
  • Block size = 256 bytes
  • Word size = 64 bits = 8 bytes
  • Words per cache block = 2568=32 words\frac{256}{8} = 32\text{ words}

Miss penalty calculation:

  • First word retrieval time = 20 ns20\text{ ns}
  • Remaining 32−1=3132 - 1 = 31 words take 5 ns5\text{ ns} each
  • Total miss penalty TmissT_{\text{miss}}:
    Tmiss=20+(31×5)=20+155=175 nsT_{\text{miss}} = 20 + (31 \times 5) = 20 + 155 = 175\text{ ns}

Average Memory Access Time (AMAT):

AMAT=Tcache+M×Tmiss\text{AMAT} = T_{\text{cache}} + M \times T_{\text{miss}}
AMAT=3+0.06×175=3+10.5=13.5 ns\text{AMAT} = 3 + 0.06 \times 175 = 3 + 10.5 = 13.5\text{ ns}
Final answer

13.5

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2020 Computer Science and Information Technology (CS)
Question
31 of 65, printed as CS Q.21
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.