The tag bits in direct mapping can be given by

2024

The tag bits in direct mapping can be given by

  1. A.

    log2 m

  2. B.

    log2 (m/n)

  3. C.

    log2 n

  4. D.

    log2 mn

Attempted by 126 students.

Show answer & explanation

Correct answer: B

Key idea: In direct mapping, every main-memory block maps to exactly one cache line.

  • Let the number of main-memory blocks be m.

  • Let the number of cache lines be n.

  • For a fixed cache line, the number of possible memory blocks that can map there is m/n.

  • The tag must identify which one of these m/n blocks is currently present.

Therefore: tag bits = log2(m/n).

Final answer: log2(m/n).

Explore the full course: Niacl Ao It Specialist