LRU Replacement Policy Counters Method Example 4-way set associative cache Need 2-bit counter for each block Address Subsequent Tag Hit/Miss C0 C1 C2 C3 Actions Initial. 0 0 0 0 4 Miss 0 1 1 1 Block 0 filled 5 Miss 1 0 2 2 Block 1 filled 4 Hit 0 1 2 2 Block 0 accessed 6 Miss 1 2 0 3 Block 2 filled 7 Miss 2 3 1 0 Block 3 filled 5 Hit 3 0 2 1 Block 1 accessed 8 Miss 0 1 3 2 Block 0 replaced 9 Miss 1 2 0 3 Block 2 replaced
LRU Replacement Policy Reference Matrix Method Example 4-way set associative cache Need 4 x 4 Matrix 1 1 1 1 3 3
LRU Replacement Policy Reference Matrix Method Example (Contd.) 1 1 1 1 1 1 1 1 1 1 2 2
LRU Replacement Policy Reference Matrix Method Example (Contd.) 1 1 1 1 1 1 1 1