GATE / CS ARCHIVE

GATE CSE 2001 / QUESTION 9(b)

Cache tag width

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

GATE 2001, Q9(b) Descriptive
Report issue

Cache Memory

Question 9(b), GATE 2001: 32-bit byte addresses; cache data capacity 256 KB=2^18 bytes; 4-way set associative; 16-byte blocks.

Task: Find the tag-field width per block.
Question 9(b), GATE 2001: 32-bit byte addresses; cache data capacity 256 KB=2^18 bytes; 4-way set associative; 16-byte blocks.

Task: Find the tag-field width per block.
Tap to enlarge
Shared context

32-bit byte addresses; cache data capacity 256 KB=2^18 bytes; 4-way set associative; 16-byte blocks.

Answer & solution

Answer: 16 tag bits per block. (no official key was published)

Step through it (7 steps)

1. An address separates into tag, set index, and byte offset. The 16-byte block needs log₂16=4 offset bits.

2. There are (256×1024)/(4×16)=4096 sets, so the set index needs log₂4096=12 bits.

3. The remaining bits are tag bits: 32−12−4=16. In bit positions, tag=A31…A16, set=A15…A4, byte offset=A3…A0.

4. Associativity affects the number of sets and hence the tag width. There is no address field selecting a way; the stored tags determine which of the four candidate ways matches.

Original paper, page 8