recategorized by
6,458 views
14 votes
14 votes

The following page addresses, in the given sequence, were generated by a program:

$\text{1 2 3 4 1 3 5 2 1 5 4 3 2 3}$

This program is run on a demand paged virtual memory system, with main memory size equal to $4$ pages. Indicate the page references for which page faults occur for the following page replacement algorithms.

  1. LRU
  2. FIFO

Assume that the main memory is initially empty.

recategorized by

2 Answers

Best answer
18 votes
18 votes
LRU :  $1,2,3,4,5,2,4,3,2$
FIFO : $1,2,3,4,5,1,2,3$
edited by
2 votes
2 votes

LRU=9

1 2 3 4 1 3 5 2 1 5 4 3 2 3
      4 4 4 4 2 2 2 2 3 3 3
    3 3 3 3 3 3 3 3 4 4 4 4
  2 2 2 2 2 5 5 5 5 5 5 5 5
1 1 1 1 1 1 1 1 1 1 1 1 2 2
F F F F     F F     F F F  

FIFO=8

1 2 3 4 1 3 5 2 1 5 4 3 2 3
      4 4 4 4 4 4 4 4 4 4 3
    3 3 3 3 3 3 3 3 3 3 2 2
  2 2 2 2 2 2 2 1 1 1 1 1 1
1 1 1 1 1 1 5 5 5 5 5 5 5 5
F F F F     F   F       F F

 

Related questions

25 votes
25 votes
4 answers
1
Kathleen asked Sep 29, 2014
5,674 views
Write a concurrent program using $\text{parbegin-parend}$ and semaphores to represent the precedence constraints of the statements $S_1$ to $S_6$, as shown in figure belo...
28 votes
28 votes
4 answers
2
Kathleen asked Sep 29, 2014
6,409 views
The details of an interrupt cycle are shown in figure.Given that an interrupt input arrives every $1$ msec, what is the percentage of the total time that the CPU devote...
28 votes
28 votes
3 answers
4
Kathleen asked Sep 29, 2014
13,079 views
Assume that the following jobs are to be executed on a single processor system$$\begin{array}{|c|c|} \hline \textbf{Job Id} & \textbf{CPU Burst Time} \\\hline \text{p} ...