Memory Hierarchy
In a system with 4 KB pages and 64-byte lines, an L1 cache is to be virtually indexed and physically tagged (VIPT) with the index and offset taken only from page-offset bits. If it is 8-way set-associative, what is its maximum capacity?
- A32 KB
- B4 KB
- C256 KB
Show answer and explanation
Answer: A. 32 KB
Addresses within a 4 KB = 2¹² page use 12 bits, which are identical in virtual and physical addresses. Keeping index plus offset within 12 bits limits each way to 2¹² = 4 KB. With 8 ways, the cache can be up to 4 KB × 8 = 32 KB. 4 KB gives only the capacity of one way. At 256 KB the index would include page-number bits, letting the same physical address land in different sets.
- A. Correct. 4 KB per way × 8 ways = 32 KB.
- B. 4 KB is the capacity of a single way.
- C. At 256 KB the index no longer fits within the page offset.