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: 4096 sets. (no official key was published)
Step through it (7 steps)
1. First count cache blocks: 218 bytes ÷24 bytes/block =214 blocks, or 16,384 blocks.
2. Four-way associativity means four blocks in each set, not four sets. Divide by four to obtain 214/2²=212=4096 sets.
3. Equivalently, one set holds 4×16=64 data bytes, and 262,144/64=4096. This cross-check uses the complete data capacity.
4. Consequently the set index requires 12 bits, a fact used when partitioning the address in later parts.