1Conceptual Review¶
Question
Solution
Solution
2Short Exercises¶
True/False: For the same cache size and block size, a 4-way set associative cache will have fewer index bits than a direct-mapped cache.
Solution
True. A direct-mapped cache needs to index every block of the cache, whereas a 4-way set associative cache needs to index every set of 4 blocks. The 4-way set associative cache will have 2 fewer index bits than the direct-mapped cache.
True/False: Caches see an immediate improvement in memory access time at program execution
Solution
False. A cache starts off ‘cold’ and requires loading in values in blocks at first directly from memory, forcing compulsory misses. This can be somewhat alleviated by the use of a hardware prefetcher, which uses the current pattern of misses to predict and prefetch data that may be accessed later on