GATE Computer ScienceModerateGATE CS (PYQ pattern)

A virtually indexed, physically tagged cache is 32 KB, 4-way set-associative with 32-byte blocks, and pages are 4 KB. To avoid synonyms, the OS may use page colouring (a virtual page and its frame must agree on the index bits above the page offset), or the hardware designers may raise the associativity at the same capacity. How many colours must the OS enforce, and what is the least associativity that removes the problem without OS help?

  1. A. 2 colours; 16-way
  2. B. 2 colours; 8-way
  3. C. 8 colours; 8-way
  4. D. 4 colours; 8-way

Correct answer: B. 2 colours; 8-way

Sets = 32 KB / (4 × 32) = 256 → 8 index + 5 offset = 13 bits, one more than the 12-bit page offset: 2¹ = 2 colours. Without colouring, index + offset must fit in 12 bits: capacity / ways ≤ 4 KB → ways ≥ 8.

More Computer Organization and Architecture questions

Exams that ask this topic