Skip to main content

Why direct mapping needs no replacement

Short answer

In direct mapping each memory block maps to exactly one cache line (block mod number of lines). On a miss the incoming block must replace the block in that specific line; there is no choice among multiple lines, so no replacement algorithm is needed.

Give reasons why a replacement algorithm is not required in the direct mapping technique.

In direct mapping each main-memory block can be placed in only one fixed cache line, given by line = block mod number of lines. When a miss occurs, the new block must go to that one line, and whatever block is there is simply overwritten. There is no choice between several candidate lines, so no replacement algorithm is needed to select a victim. The decision is already made by the mapping function itself.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computer Organization and Architecture chapter 6 questions →