Similar questions 15 more →
Cache Memory


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.