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?

  1. A. page 2 (10010100)
  2. B. page 0 (01101100)
  3. C. page 3 (01011000)
  4. 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

Exams that ask this topic