Set-associative cache combines ideas of direct-mapped and fully-associative cache. The cache is divided into contiguous equal-sized sets.

A -way set-associative cache has multiple sets of $n$ blocks.

In a set-associative cache, each address maps to only one set: $$MM \text{ block number } \% \text{ number of sets}$$

A set-associative address is composed of the following: ?

  • uniquely identifies which main memory block is in the cache (in combination with the set)
  • uniquely identifies which set in the cache
  • uniquely identifies which word in the block