Computer Architecture
Faculty of Computer Science & Engineering - HCMUT
Chapter 5: Large and Fast:
Exploiting Memory Hierarchy
Binh Tran-Thanh
thanhbinh@hcmut.edu.vn
This chapter contents
Memory technology/ hierarchy
Cache and Virtual Memory
Memory performance
This chapter outcomes
Students who complete this course will be
able to
Explain the structure of a memory hierarchy.
Deeply understand how Memory, Cache, and
Virtual Memory work at the hardware level.
Estimate the performance of a memory
hierarchy as well as a system.
10/31/2021 Faculty of Computer Science and Engineering 3
Principle of Locality
Programs access a small proportion of their address
space at any time
Temporal locality
Items accessed recently are likely to be accessed again
soon
e.g., instructions in a loop, induction variables
Spatial locality
Items near those accessed recently are likely to be
accessed soon
E.g., sequential instruction access, array data
10/31/2021 Faculty of Computer Science and Engineering 4
Warm up
for (int i =0;i <MAX_SIZE;i ++){
Sum += Array[i];
}
Which variables/instructions exhibit
temporal locality?
Which variables /instructions exhibit spatial
locality?
10/31/2021 Faculty of Computer Science and Engineering 5