Memory Hierarchy
In a fully associative cache, how many address bits are used for the index (the part that selects a set)?
- A6 bits, determined by the line size
- BAs many bits as there are lines
- C0 bits
Show answer and explanation
Answer: C. 0 bits
In a fully associative cache any data can go anywhere, so the whole cache is a single set. No set needs to be selected, so the index is 0 bits; the address splits into just offset and tag, and every access compares against all tags. That requires many comparators, so it does not suit large caches and is used for small structures such as TLBs. The line size determines the offset width, not the index.
- A. The line size determines the number of offset bits.
- B. Index bits scaled to the line count apply to direct-mapped caches.
- C. Correct. With only one set, no index is needed.