GATE / CS ARCHIVE

GATE CSE 2012 / QUESTION 54

Tag bits in a four-way cache

Computer Organization & Architecture · Cache Memory · Full GATE CSE 2012 paper

GATE 2012, Q54 2 marks · MCQ
Report issue

Cache Memory

Question 54, GATE 2012: A 256 KByte, four-way set-associative write-back cache uses 32-byte blocks and 32-bit byte addresses. Every tag-directory entry holds the tag plus 2 valid bits, 1 modified bit, and 1 replacement bit.
How many address tag bits are there?
(A) 11 (B) 14 (C) 16 (D) 27.
Question 54, GATE 2012: A 256 KByte, four-way set-associative write-back cache uses 32-byte blocks and 32-bit byte addresses. Every tag-directory entry holds the tag plus 2 valid bits, 1 modified bit, and 1 replacement bit.
How many address tag bits are there?
(A) 11 (B) 14 (C) 16 (D) 27.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Step through it (7 steps)

Using binary cache units, 256 KiB/32 bytes=8192 cache lines. Four lines per set give 2048=2¹¹ sets, so the set index uses 11 bits. A 32-byte block requires 5 byte-offset bits. The remaining address bits are tag bits: 32−11−5=16, C.

Check: The address splits as [16 tag bits | 11 set bits | 5 byte-offset bits]. Associativity reduces the number of sets relative to the number of lines, so using 13 line-index bits would incorrectly treat the cache as direct mapped.

Original paper, page 15 · Answer key