CS FundamentalsVery hardGATE CS

The aging algorithm keeps an 8-bit counter per page; every tick it shifts the counter right by one and puts the page's reference bit into the leftmost bit, then clears the bit. Over 4 ticks page X's reference bits are 1, 0, 0, 1 and page Y's are 0, 1, 1, 0 (first tick first). Counters start at 0. Which page is evicted?

  1. A. X, because it was referenced fewer times
  2. B. Y, because it was referenced more times
  3. C. Y, because X's counter 10010000 is larger than Y's 01100000
  4. D. X, because its counter 10010000 is smaller

Correct answer: C. Y, because X's counter 10010000 is larger than Y's 01100000

After the four ticks the most recent tick is the leftmost bit: X = 1001 0000 (binary) = 144, Y = 0110 0000 = 96. The page with the smallest counter (least recently used, approximately) is the victim: Y.

More Operating Systems questions

Exams that ask this topic