499 views
0 0 votes
Consider the following page address trace generated by a cache main memory scheme and has a cache capacity of four pages:

1,6, 4,5, 1, 4, 3, 2, 1, 2, 1, 4, 6, 7, 4

Assuming the cache initially has pages 1, 2, 3, and 4, show the cache trace using the LRU (Least Recently Used) policy and FIFO (First In First Out) replacement. Contrast this with all necessary steps.

1 Answer

0 0 votes
Page Accessed LRU Cache  FIFO Cache

1                       $[2, 3, 4, 1]$    $[1, 2, 3, 4]$
6                       $[3, 4, 1, 6]$    $[2, 3, 4, 6]$
4                       $[3, 1, 6, 4]$    $[2, 3, 4, 6]$
5                       $[1, 6, 4, 5]$    $[3, 4, 6, 5]$
1                       $[6, 4, 5, 1]$    $[4, 6, 5, 1]$
4                       $[6, 5, 1, 4]$    $[4, 6, 5, 1]$
3                       $[5, 1, 4, 3]$    $[6, 5, 1, 3]$
2                       $[1, 4, 3, 2]$    $[5, 1, 3, 2]$
1                       $[4, 3, 2, 1]$    $[5, 1, 3, 2]$
2                       $[4, 3, 1, 2]$    $[5, 1, 3, 2]$
1                       $[4, 3, 2, 1]$    $[5, 1, 3, 2]$
4                       $[3, 2, 1, 4]$    $[1, 3, 2, 4]$
6                       $[2, 1, 4, 6]$    $[3, 2, 4, 6]$
7                       $[1, 4, 6, 7]$    $[2, 4, 6, 7]$
4                       $[1, 6, 7, 4]$    $[2, 4, 6, 7]$
Position:
Show:

Related questions

1 1 vote
0 0 answers
556
556 views
Reetu Chaudhary asked May 6, 2024
556 views
For a certain page trace starting with no page in the memory, a demand-paged memory system operated under the LRU replacement policy results in 9 and 11 page faults when ...
4 4 votes
1 answers 1 answer
837
837 views
Sona Barman asked Jan 18, 2018
837 views
Self doubt:What is the rule or keyb point we should keep in mind while solving problems on LRU page replacement algorithm? Please explain with examples.
86 86 votes
13 answers 13 answers
31.7k
31.7k views
admin asked Feb 15, 2023
31,720 views
Consider the following two-dimensional array $\text{D}$ in the $\text{C}$ programming language, which is stored in row-major order:int D[128][128];Demand paging is used f...
2 2 votes
1 1 answer
979
979 views
admin asked Dec 15, 2022
979 views
Compute the hit rate and miss/fault rate in least recently used page replacement algorithm for the given reference string with $4$ page frames. String: $7 \; 0 \; 1 \; 2 ...