3. Lecture 19 Basics of Cache
3. Lecture 19 Basics of Cache
How do we know if
the data is present?
Where do we look?
FIGURE 5.7 The cache just before and just after a
reference to a word Xn that is not initially in the cache.
This reference causes a miss that forces the cache to fetch
Xn from memory and insert it into the cache.
Direct
FIGURE 5.8 mapped: only one
A direct-mapped cachechoice
with eight entries
showing the addresses of memory words between 0 and
(Block
31 that address)
map to the modulo
same cache (#Blocks in cache)
locations.
#Blocks
Because there are is a
eight words
in the cache, an address X
maps power
to the of 2
direct-mapped
cache word X modulo 8. That
Use
is, the low-order
low-order log2(8) = 3 bits
are usedaddress
as the cachebits
index.
31 10 9 4 3 0
Tag Index Offset
22 bits 6 bits 4 bits
In fact, this block maps all addresses between 1200 and 1215