CS FundamentalsVery hardGATE CS (PYQ pattern)

A machine has 48-bit virtual addresses, 4 KB pages and 4 GB of physical memory and uses a hashed inverted page table. Each IPT entry (one per frame) holds the virtual page number, a 16-bit process id, a chain link to the next entry (a frame number) and 4 flag bits, rounded up to whole bytes. A hash anchor table with twice as many slots as frames holds one frame number per slot, also rounded up to whole bytes. What is the total size of both tables?

  1. A. 16 MB
  2. B. 10 MB
  3. C. 14 MB
  4. D. 12 MB

Correct answer: A. 16 MB

Frames = 2^32 / 2^12 = 2^20, so a frame number needs 20 bits. VPN = 48 - 12 = 36 bits. Entry = 36 + 16 + 20 + 4 = 76 bits -> 10 bytes, IPT = 10 MB. Anchor = 2^21 slots x 3 bytes = 6 MB. Total 16 MB. 10 MB omits the anchor table; 14 MB uses one 4-byte anchor slot per frame (4 MB).

More Operating Systems questions

Exams that ask this topic