Lecture Slides 07 074-Caches-Org
Lecture Slides 07 074-Caches-Org
of Washington
Cache
Organiza3on
University
of
Washington
Use
tags!
Memory Cache
0000
0001
0010
0011
0100
0101 Index Tag Data
0110 00 00
0111 01 ??
1000 10 01
1001 11 01
1010
1011
1100
1101
1110
1111
Cache
Organiza3on
University
of
Washington
Cache
Organiza3on
University
of
Washington
A
puzzle.
¢ What
can
you
infer
from
this:
Cache
Organiza3on
University
of
Washington
Cache
Organiza3on
University
of
Washington
Associa3vity
¢ What
if
we
could
store
data
in
any
place
in
the
cache?
¢ But
that
might
slow
down
caches…
so
we
do
something
in
between.
1-way 2-way 4-way 8-way
8 sets, 4 sets, 2 sets, 1 set,
1 block each 2 blocks each 4 blocks each 8 blocks
Cache
Organiza3on
University
of
Washington
? bits ? bits
?-bits Block
4-bit Address Offset
Cache
Organiza3on
University
of
Washington
Cache
Organiza3on
University
of
Washington
Block replacement
¢ Any empty block in the correct set may be used for storing data.
¢ If there are no empty blocks, which one should we replace?
¢ Replace something, of course, but what?
§ Caches typically use something close to least-recently-used
Cache
Organiza3on
University
of
Washington
Another
puzzle.
¢ What
can
you
infer
from
this:
Cache Organiza3on