CS FundamentalsVery hardGATE CS · Advanced
The aging algorithm keeps an 8-bit counter per page for pages 0-3. At the end of every clock tick each counter is shifted right by one bit and then the page's reference bit for that tick is placed in the leftmost bit. The pages referenced during six successive ticks were: {0,1,2}, {0,1,3}, {2,3}, {0}, {0,1,3}, {2}. After the sixth tick, which page is chosen for replacement and what is its counter?
- A. page 2 (10010100)
- B. page 0 (01101100)
- C. page 3 (01011000)
- D. page 1 (01001100)
Correct answer: D. page 1 (01001100)
Shifting and inserting the reference bit each tick gives counters ['01101100', '01001100', '10010100', '01011000'] for pages 0-3; the smallest is page 1. The page chosen need not equal the true LRU page (page 0): aging only remembers the last 8 ticks and weights recent ticks by position.
More Operating Systems questions
- A file system has 1 KB blocks and 4-byte block pointers; the inode (already in memory) holds 12 direct pointers and one single-, one…
- Three periodic tasks (C, T) with deadline equal to period, all released at t = 0, are: (1, 4), (4, 9), (4, 15). Their total utilisation is…
- Four processes with CPU bursts 5, 3, 8 and 2 ms arrive at time 0 in that order and are scheduled by FCFS. What is the average waiting time?
- Processes with bursts 6, 8, 7 and 3 ms all arrive at time 0 and are scheduled by non-preemptive SJF. What is the average waiting time?
- How many page faults occur under FIFO replacement with 3 frames (initially empty) for the reference string 2, 3, 2, 1, 5, 2, 4, 5, 3, 2…
- How many page faults occur under LRU replacement with 3 frames (initially empty) for the reference string 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0…