GATE / CS ARCHIVE

GATE CSE 2012 / QUESTION 55

Cache directory size including per-line metadata

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

GATE 2012, Q55 2 marks · MCQ
Report issue

Cache Memory

Question 55, 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.
What is the tag-directory size?
(A) 160 Kbits (B) 136 Kbits (C) 40 Kbits (D) 32 Kbits.
Question 55, 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.
What is the tag-directory size?
(A) 160 Kbits (B) 136 Kbits (C) 40 Kbits (D) 32 Kbits.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Step through it (9 steps)

There are 256×1024/32=8192 cache lines and hence 8192 tag-directory entries. The preceding calculation gives a 16-bit address tag. Each entry additionally has the explicitly specified 2 valid bits, 1 modified bit and 1 replacement bit, for 16+2+1+1=20 bits. The directory is 8192×20=163, 840 bits=160 Kibits, option A (printed as Kbits). Count entries per cache line, not per set; the problem explicitly assigns the replacement bit per entry.

Check: Four ways do not mean only one tag per set: each way stores a distinct block and needs its own tag and metadata. Equivalently, 2048 sets×4 entries/set×20 bits/entry=163840 bits, confirming the per-line calculation.

Original paper, page 15 · Answer key