Unformatted text preview: rashing conﬂict misses. Practice Problem 6.7:
In the previous dotprod example, what fraction of the total references to x and y will be hits once we have padded array x? Why Index With the Middle Bits?
You may be wondering why caches use the middle bits for the set index instead of the high order bits. There is a good reason why the middle bits are better. Figure 6.31 shows why. If the high-order bits are used as an index, then some contiguous memory blocks will map to the same cache set. For example, in the ﬁgure, the ﬁrst four blocks map to the ﬁrst cache set, the second four blocks map to the second set, and so on. If a program has good spatial locality and scans the elements of an array sequentially, then the cache can only hold a block-sized chunk of the array at any point in time. This is an inefﬁcient use of the cache. Contrast this with middle-bit indexing, where adjacent blocks always map to different cache lines. In this case, the cache can hold an entire -sized chunk of the array, where is the cache size. 6.4. CACHE MEMORIES
High-Order Bit I...
View Full Document