Cache Memory Cache Memory
Cache Memory Cache Memory
11
Cache Memory
Small amount of fast memory, expensive memory Sits between normal main memory (slower) and CPU May be located on CPU chip or module It keeps a copy of the most frequently used data from the main memory. Reads and writes to the most frequently used addresses will be serviced by the cache. We only need to access the slower main memory for less frequently used data.
Principle of Locality
In practice, most programs exhibit locality, which the
cache can take advantage of. The principle of temporal locality says that if a program accesses one memory address, there is a good chance that it will access the same address again. The principle of spatial locality says that if a program accesses one memory address, there is a good chance that it will also access other nearby addresses.
Speed
More cache is faster (up to a point) Checking cache for data takes time
11