| Scheme Name | Number of Sets | Blocks per Set |
|---|---|---|
| Direct mapped | Number of blocks in cache | 1 |
| Set associative | Number of blocks in the cache / Associativity | Associativity (typically 2-16) |
| Fully associative | 1 | Number of blocks in the cache |
| The largest gains are obtained in going from direct mapped to two-way set associative. Smaller caches obtain a significantly larger absolute benefit from associativity because the base miss rate of a small cache is larger. |
|
| Associativity | Location Method | Comparisons Required |
|---|---|---|
| Direct mapped | Index | 1 |
| Set associative | Index the set, search among elements | Degree of associativity |
| Fully associative | Search all cache entries | Size of the cache |
| Separate lookup table | 0 |
|
Wife: How many women have you slept with? Me: Only you, I was too busy to sleep while shagging the other women! Wife: Right, pack your bags I want you out! Me: That’s fine. Wife: I hope you have a slow and painful death! Me: I’m confused, does that mean you want me to stay now? |