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: Four 16-bit equality comparators for a parallel four-way lookup. (no official key was published)
1. The 12 index bits select one set containing four candidate cache blocks. The requested block may occupy any of those four ways.
2. The incoming 16-bit tag must be compared with each of the four stored 16-bit tags. A standard parallel lookup therefore uses four comparators, each comparing two 16-bit quantities.
3. Each comparator produces one match bit, normally qualified by the corresponding valid bit. The hit way selects its data.
4. Comparators for every cache block are unnecessary because the index has already selected one set. A serial implementation could reuse hardware with additional latency, but the conventional associative lookup requested here is parallel.