A direct mapped cache memory of 1 MB has a block size of 256 bytes. The cache…
2020
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 ________ .
Attempted by 99 students.
Show answer & explanation
Correct answer: 13.5
Given data (key points):
Cache size = 1 MB (not needed directly for time calculation).
Block size = 256 bytes; word size = 64 bits = 8 bytes → words per block = 256/8 = 32.
Cache access (hit) time = 3 ns; hit rate = 94% → miss rate = 6%.
Compute the miss penalty (time to bring an entire block from main memory):
First word: 20 ns.
Remaining 31 words: 31 × 5 ns = 155 ns.
Total miss penalty = 20 + 155 = 175 ns.
Average memory access time (AMAT):
Use AMAT = hit time + miss rate × miss penalty.
AMAT = 3 ns + 0.06 × 175 ns = 3 + 10.5 = 13.5 ns.
Rounded to one decimal place: 13.5 ns.
Note: A common mistake is to compute 0.94×3 + 0.06×175 = 13.3 ns; this omits the cache access time on misses. The correct form is hit time + miss rate×miss penalty (or equivalently hit_rate×hit_time + miss_rate×(hit_time+miss_penalty)), which gives 13.5 ns.