Memory Hierarchy

What is the role of the valid bit attached to each cache line?

  1. AIt shows whether the line has been modified
  2. BIt shows the order in which the line will be evicted
  3. CIt shows if real data is present
Show answer and explanation

Answer: C. It shows if real data is present

Right after power-up or after a line is invalidated, cache contents are meaningless. A line whose valid bit is 0 is not counted as a hit even if its tag happens to match; the bit is set to 1 when correct data is loaded. This prevents empty lines from being mistaken for hits. Modification is shown by the dirty bit used in write-back caches, and eviction order is tracked by replacement information such as LRU state.

  • A. Modification is shown by the dirty bit.
  • B. Eviction order is separate replacement-policy information.
  • C. Correct. It shows whether real data is present, preventing false hits on empty lines.