This preview shows page 1. Sign up to view the full content.
Unformatted text preview: block offset bits of ½¼¼¾ indicate that the copy of Û starts at byte 4 in the block. (We are assuming that words are 4 bytes long.) Line Replacement on Misses in Direct-Mapped Caches
If the cache misses, then it needs to retrieve the requested block from the next level in the memory hierarchy and store the new block in one of the cache lines of the set indicated by the set index bits. In general, if the set is full of valid cache lines, then one of the existing lines must be evicted. For a direct-mapped cache, where each set contains exactly one line, the replacement policy is trivial: the current line is replaced by the newly fetched line. Putting it Together: A Direct-Mapped Cache in Action
The mechanisms that a cache uses to select sets and identify lines are extremely simple. They have to be, because the hardware must perform them in only a few nanoseconds. However, manipulating bits in this way can be confusing to us humans. A concrete example will help clarify the process. Suppose we have a direct-mapped cache where
´ Ë Ñµ...
View Full Document
- Spring '10
- The American