CS FundamentalsVery hardGATE CS

Physical memory is 64 MB with 4 KB frames; virtual addresses are 32-bit. Each PTE holds a frame number plus 4 control bits, and PTE size is rounded up to a power-of-two number of bytes. How many PTEs fit in one page, and how many levels does a hierarchical table need if each table fits in one page?

  1. A. 1365 PTEs per page; 2 levels
  2. B. 1024 PTEs per page; 2 levels
  3. C. 1024 PTEs per page; 3 levels
  4. D. 512 PTEs per page; 3 levels

Correct answer: B. 1024 PTEs per page; 2 levels

Frames = 2²⁶ / 2¹² = 2¹⁴, so a PTE needs 14 + 4 = 18 bits, which rounds up to 4 bytes (the next power of two above 3). A 4 KB page holds 1024 PTEs (10 index bits). The VPN is 32 − 12 = 20 bits = 2 × 10, so 2 levels suffice.

More Operating Systems questions

Exams that ask this topic