In: Electrical Engineering
In set-associative mapping, why when having the choice to replace of which cache line to replace do we choose the ones with D=0?
Ans: The question is if one fetches cache line from the memory so where should it be placed?
Well it depends on the type of mapping for example
Now the main question is if we have 2 or more option for placement of cache line in n-way and fully associative system. We must able to decide which line should be replaced.
To achieve this objective the common scheme used is named as least recently used (LRU) i.e. least used line will be evicted or replaced.
The cache has the relative order in which blocks are used so far.
For example, we have to place line 3 and for its replacement suppose we have two locations 0 and 2. If location 0 is used recently the line 2 will be replaced with line 3.