CPUs and architecture
Which correctly describes a set-associative cache?
- AData for a given address can be placed in any of several locations (ways) within a fixed set
- BData for a given address can be placed in only one location in the cache
- CData can be placed anywhere in the cache
Show answer and explanation
Answer: A. Data for a given address can be placed in any of several locations (ways) within a fixed set
In a set-associative cache, part of the address selects a set, and data may occupy any of that set's ways—eight candidate slots in an 8-way cache—reducing conflict misses compared with direct mapping. More ways need more comparators and power, so the way count is kept moderate—for example, 8–12 ways for L1 and around 16 for L3. A cache in which data can go anywhere is fully associative.
- A. Correct. It can be placed in several ways within a fixed set.
- B. Only one possible location is a direct-mapped cache.
- C. Being able to place data anywhere is a fully associative cache.