Q3Computer Architecture and Organization
Question
2 marks
Explain the principle of locality of reference.
Answer
Locality of reference is the mathematical principle stating that CPUs tend to repeatedly access a heavily clustered, restricted set of memory addresses.
The Principle of Locality mathematically justifies the existence of Cache memory. "Spatial Locality" dictates that if address X is read, address X+1 will likely be read next (e.g., arrays). "Temporal Locality" dictates that if address X is read, it will likely be read again very soon (e.g., loops).