-
This is the combination of Direct and Associative mapping
-
In this case blocks of the cache are grouped into sets and the mapping allows a block of main memory to reside in any block of particular set
-
Example: The 6 bits set field of the address determines which set the cache might contain the addressed block.
-
The tag field of the address must be associatively compared to the tags of the two blocks of the set to check if the desired block is present
Advantages
- The contention problem of the direct method is overcome by having few choices for block replacement
- The hardware cost is reduced by decreasing the size of the associative search
Replacement Algorithms
When new block is to be brought into the cache and all the positions that it may occupy are full, then the controller must decide which of the old blocks to overwrite
- Least Recently Used algorithm (LRU)
In this the block that is not referenced for the longest time is overwritten. This block is called least recently used block (LRU) and the technique is called the LRU replacement algorithm
- First in First out algorithm (FIFO)
In this the block which has entered the cache first will be overwritten
Cache Mapping Functions << Previous
Next >> Virtual Memory
Support us generously: contact@lessons2all.com
Our aim is to provide information to the knowledge
seekers.