1 Fig. 2 2. Fig. 2 shows a circular list for clock page replacement algorithm. T
ID: 3737134 • Letter: 1
Question
1 Fig. 2 2. Fig. 2 shows a circular list for clock page replacement algorithm. The reference bit for page A, B, C, D, E, F, G, H, I, J, K, L is 1, 1, 1, 1,0, 0, 0, 0, 1, 1, 1, 1, correspondingly. Which page will be replaced when page fault occurs? Answer: 3. A computer has four page frames and eight pages. Assume Least Recently Used (LRU) page replacement algorithm is used. How many page fault will occur with the refèrence string 0 70540412? Page fault: After above processing is finished, the linked list becomes:Explanation / Answer
In cycle page replacement algorithm
*When a page fault occurs, the page being pointed to by the hand is inspected.
*If its reference bit is 0, the page is removed , the new page is inserted into the clock in its place, and the hand is advanced one position.
*If reference bit is 1, it is cleared to 0 and the hand is advanced to the next page. This process is repeated until a page is found with reference bit 0.
ANSWER-So next page removed when page fault occur is E . because C and D pages have refernece bit 1 .
b)
In LRU page replacement algorithm
The page to be replaced is least recently used. The idea is based on locality of reference, the least recently used page is not likely.
Initially all slots are empty, so when 0 7 0 5 4 are allocated to the empty slots —> 4 Page faults
0 is already their so —>0 Page fault.
Again 0 comes so ----> 0 Page fault.
Now 4 come , as it is there in list so --->0 Page fault.
when 1 came it will take the place of 7 because it is least recently used —>1 Page fault
when 2 came it will take the place of 5 because it is least recently used —>1 Page fault
Total number of page faults - 4+1+1 = 6
pages now in the linked list = ( 0 , 4 , 1 , 2)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.