Lecture Slides 07 074-Caches-Org
Lecture Slides 07 074-Caches-Org
Cache Organization
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 Organization
University of Washington
Cache Organization
University of Washington
A puzzle.
What can you infer from this:
Cache Organization
University of Washington
2, 6, 2, 6, 2, …? 0000
0001
0010
0011
0100 Index
0101
0110 00
0111 01
1000 10
1001 11
1010
1011
1100
1101
1110
1111
Cache Organization
University of Washington
Associativity
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 Organization
University of Washington
? bits ? bits
?-bits Block
4-bit Address Offset
Cache Organization
University of Washington
Cache Organization
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 Organization
University of Washington
Another puzzle.
What can you infer from this:
Cache Organization