Question: A 2-way set associative cache is using the true LRU replacement algorithm discussed in class. A designer proposes to use a new least frequently used

A 2-way set associative cache is using the true LRU replacement algorithm discussed in class. A designer proposes to use a new least frequently used (LFU) algorithm, which works as follows: On a cache miss, if no empty (invalid) block is found in a set, then LFU chooses to evict the block that has been accessed the least number of times since being brought into the cache. If multiple candidate blocks fit this criteria, then the LFU algorithm chooses the least recently used block among the candidate blocks. (a) Consider the following sequence of accesses to a cache set: A, A, B, C, B, C, A Assume that the set is initially empty. Compare the number of hits for the LRU and LFU policies. (b) Construct an access sequence for which the LFU policy results in more hits than the LRU policy. Your access sequence must include 5 or fewer accesses. Similar to part(a), you need to consider accesses going only to a single cache set and assume that the set is initially empty
Step by Step Solution
There are 3 Steps involved in it
Lets solve this step by step a Comparison of Hits for LRU and LFU Policies Access Sequence A A B C B ... View full answer
Get step-by-step solutions from verified subject matter experts
