Cache Memory
Cache Memory
Cache Memory
• 1. Direct Mapping
• 2. Associative Mapping
• 3. Set Associative Mapping
1. Direct Mapping
• The direct mapping technique is simple and
inexpensive to implement.
•First-In-First-Out (FIFO):
•The FIFO algorithm selects for replacement the item that has been in the cache from the longest
time.
•Random:
•The random algorithm selects for replacement the item randomly.
Writing into Cache
When memory write operations are performed,
CPU first writes into the cache memory. These
modifications made by CPU during a write
operations, on the data saved in cache, need to be
written back to main memory or to auxiliary
memory.
The advantage of the write-through cache is that the main memory always
contains the same data as the cache contains.
The updated locations in the cache memory are marked by a flag so that later on,
when the word is removed from the cache, it is copied into the main memory.
The words are removed from the cache time to time to make room for a new block
of words.
Thank You!