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?
- A. 2 colours; 16-way
- B. 2 colours; 8-way
- C. 8 colours; 8-way
- 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.
Practise more Computer Organization and Architecture questionsComputer Organization and Architecture: notes and key points
More Computer Organization and Architecture questions
- A loop reads a[i] and then b[i] for i = 0..1023, where a and b are int arrays (4 bytes) starting at byte addresses 0 and 4096. The data…
- On a 5-stage pipeline with forwarding, 30% of instructions are loads. Half of them are followed immediately by a dependent instruction…
- After a section of a program was made 10 times faster, measurements on the improved program show that the improved section accounts for…
- A fully associative cache of 3 lines (block = one word) sees the block reference string [2, 4, 4, 0, 4, 5, 5, 2, 0, 2, 2, 2, 3, 5, 2, 1]…
- A 16-bit instruction has 5-bit address fields. Two-address instructions use a 6-bit opcode; further opcodes are obtained by expanding into…
- The back-edge branch of an inner loop executes the outcome pattern T T T N (three taken, one exit), repeated for 6 consecutive outer…