CPUs and architecture

Which correctly describes a set-associative cache?

  1. AData for a given address can be placed in any of several locations (ways) within a fixed set
  2. BData for a given address can be placed in only one location in the cache
  3. 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, the address selects a set, and the data can be placed in any of several ways within that set. This reduces misses caused by competition for the same location (conflict misses) compared with a direct-mapped cache, which has only one possible location. Being able to place data anywhere is a fully associative cache.

  • 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.
Practice this topic Back to topic

More CPUs and architecture questions

  1. What is the typical size of a cache line (cache block) in many current CPUs?
  2. In a pipeline, when the next instruction immediately uses the result of the previous one (a data hazard), which technique passes the result directly to the next instruction without waiting for it to be written to the register?
  3. Which correctly describes little-endian byte order?
  4. Which technique lets one CPU core process instructions from multiple threads at the same time to make better use of the core's execution units?
  5. In microcontrollers and similar devices, which scheme assigns peripheral registers to the same address space as memory and operates them with ordinary memory read/write instructions?