GATE Computer ScienceHardGATE CS (PYQ pattern)

A direct-mapped cache with 32-byte blocks and 32-bit addresses stores, for every line, only a tag and a valid bit as metadata. The total metadata is 18,432 bits. How many lines does the cache have?

  1. A. 4096
  2. B. 2048
  3. C. 512
  4. D. 1024

Correct answer: D. 1024

With L lines: tag = 32 − log₂L − 5 and metadata = L (tag + 1). For L = 1024: tag = 17, 1024 × 18 = 18,432. Neighbouring sizes give 512 × 19 = 9728 and 2048 × 17 = 34,816.

More Computer Organization and Architecture questions

Exams that ask this topic