Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

A computer has four page frames.

The time of loading, time of last access, and the R


and M  bits for each page are as shown below (the times are in clock ticks):
 
Page Loaded Last ref. R M
0 126 280 1 0
1 230 265 0 1
2 140 270 0 0
3 110 285 1 1
(a)    Which page will NRU replace?
(b)    Which page will FIFO replace?
(c)    Which page will LRU replace?
(d)    Which page will second chance replace?

Answer:

Part-1

(a)     Which page will NRU replace?


Answer:

NRU stands for not recently used. The page for which is not referenced and modified
recently is replaced. It works as per the value of R and M bits.

According to NRU page replacement policy, page 2 will replaced. Because since the
result is randomly selected for pages with dirty-bit low and referenced-bit low (a page
of the lowest class). If that class wasn't available, then it will replace not-referenced and
dirty first and select a random page out of that class.

Part-2

(b)     Which page will FIFO replace?


Answer:

FIFO stands for first In first Out. The page which is entered first in the memory block
will be thrown out first.

According to the FIFO, Page 1 will be replaced because it's the first one in the list
(oldest with value last ref. = 265).

Part-3

(c)     Which page will LRU replace?


Answer:

LRU stands for least recently used. The page which is used most earlier in the present
memory block will be out if any new page is arrival.

According to LRU, Page 2 will be replaced because it is the oldest un-used page.
Part-4

(d)     Which page will second chance replace?


Answer:

It will change page 0 (R = 0) and replace page 1 because its R value is already 0.

You might also like