This preview shows page 1. Sign up to view the full content.
Unformatted text preview: Y
block block Each row in the table represents a cache line. The ﬁrst column indicates the set that the line belongs to, but keep in mind that this is provided for convenience and is not really part of the cache. The next three columns represent the actual bits in each cache line. Now let’s see what happens when the CPU performs a sequence of reads: 1. Read word at address 0. Since the valid bit for set 0 is zero, this is a cache miss. The cache fetches block 0 from memory (or a lower-level cache) and stores the block in set 0. Then the cache returns m (the contents of memory location 0) from block of the newly fetched cache line.
set 0 1 2 3 valid 1 0 0 0 tag 0 block m block m 2. Read word at address 1. This is a cache hit. The cache immediately returns m from block of the cache line. The state of the cache does not change. 3. Read word at address 13. Since the cache line in set 2 is not valid, this is a cache miss. The cache loads block 6 into set 2 and returns m from block of the new...
View Full Document