Cache-Hierarchies-Virtual-Memory- Notes | EduRev

: Cache-Hierarchies-Virtual-Memory- Notes | EduRev

 Page 1


1
Lecture 20: Cache Hierarchies, Virtual Memory
• Today’s topics: 
 Cache hierarchies
 Virtual memory
• Reminder:
 Assignment 8 will be posted soon (due Tue 11/21)
Page 2


1
Lecture 20: Cache Hierarchies, Virtual Memory
• Today’s topics: 
 Cache hierarchies
 Virtual memory
• Reminder:
 Assignment 8 will be posted soon (due Tue 11/21)
2
Example Access Pattern
8-byte words
101000
Direct-mapped cache:
each address maps to
a unique address
Byte address
Tag
Compare
Data array Tag array
Assume that addresses are 8 bits long
How many of the following address requests
are hits/misses?
4, 7, 10, 13, 16, 68, 73, 78, 83, 88, 4, 7, 10…
Page 3


1
Lecture 20: Cache Hierarchies, Virtual Memory
• Today’s topics: 
 Cache hierarchies
 Virtual memory
• Reminder:
 Assignment 8 will be posted soon (due Tue 11/21)
2
Example Access Pattern
8-byte words
101000
Direct-mapped cache:
each address maps to
a unique address
Byte address
Tag
Compare
Data array Tag array
Assume that addresses are 8 bits long
How many of the following address requests
are hits/misses?
4, 7, 10, 13, 16, 68, 73, 78, 83, 88, 4, 7, 10…
3
Increasing Line Size
32-byte cache
line size or 
block size
10100000
Byte address
Tag
Data array Tag array
Offset
A large cache line size 
 smaller tag array,
fewer misses because of spatial locality
Page 4


1
Lecture 20: Cache Hierarchies, Virtual Memory
• Today’s topics: 
 Cache hierarchies
 Virtual memory
• Reminder:
 Assignment 8 will be posted soon (due Tue 11/21)
2
Example Access Pattern
8-byte words
101000
Direct-mapped cache:
each address maps to
a unique address
Byte address
Tag
Compare
Data array Tag array
Assume that addresses are 8 bits long
How many of the following address requests
are hits/misses?
4, 7, 10, 13, 16, 68, 73, 78, 83, 88, 4, 7, 10…
3
Increasing Line Size
32-byte cache
line size or 
block size
10100000
Byte address
Tag
Data array Tag array
Offset
A large cache line size 
 smaller tag array,
fewer misses because of spatial locality
4
Associativity
10100000
Byte address
Tag
Data array Tag array
Set associativity 
 fewer conflicts; wasted power
because multiple data and tags are read
Way-1 Way-2
Compare
Page 5


1
Lecture 20: Cache Hierarchies, Virtual Memory
• Today’s topics: 
 Cache hierarchies
 Virtual memory
• Reminder:
 Assignment 8 will be posted soon (due Tue 11/21)
2
Example Access Pattern
8-byte words
101000
Direct-mapped cache:
each address maps to
a unique address
Byte address
Tag
Compare
Data array Tag array
Assume that addresses are 8 bits long
How many of the following address requests
are hits/misses?
4, 7, 10, 13, 16, 68, 73, 78, 83, 88, 4, 7, 10…
3
Increasing Line Size
32-byte cache
line size or 
block size
10100000
Byte address
Tag
Data array Tag array
Offset
A large cache line size 
 smaller tag array,
fewer misses because of spatial locality
4
Associativity
10100000
Byte address
Tag
Data array Tag array
Set associativity 
 fewer conflicts; wasted power
because multiple data and tags are read
Way-1 Way-2
Compare
5
Associativity
10100000
Byte address
Tag
Data array Tag array
How many offset/index/tag bits if the cache has
64 sets,
each set has 64 bytes,
4 ways
Way-1 Way-2
Compare
Read More
Offer running on EduRev: Apply code STAYHOME200 to get INR 200 off on our premium plan EduRev Infinity!