Question

Consider a computer system with 40-bit virtual addressing and page size of sixteen kilobytes. If the computer system has a one-level page table per process and each page table entry requires 48 bits, then the size of the per-process page table is _____ megabytes.

Official answer and solution
Official answer
384
From
Official GATE 2016 answer key

Solution

Calculate the number of pages in the virtual address space and multiply by the page table entry size.

Given parameters:

  • Virtual address space =40= 40 bits   ⟹  240\implies 2^{40} bytes.
  • Page size =16 KB=16×210 bytes=24×210=214 bytes= 16\text{ KB} = 16 \times 2^{10}\text{ bytes} = 2^4 \times 2^{10} = 2^{14}\text{ bytes}.

Calculate the number of pages:

Number of pages=Virtual Address SpacePage Size=240214=226 pages\text{Number of pages} = \frac{\text{Virtual Address Space}}{\text{Page Size}} = \frac{2^{40}}{2^{14}} = 2^{26}\text{ pages}

Calculate page table size:

  • Each page table entry (PTE) requires 48 bits=488=6 bytes48\text{ bits} = \frac{48}{8} = 6\text{ bytes}.
  • A one-level page table must contain an entry for every virtual page:
Total Page Table Size=226×6 bytes=6×226 bytes\text{Total Page Table Size} = 2^{26} \times 6\text{ bytes} = 6 \times 2^{26}\text{ bytes}

Convert to megabytes (1 MB=220 bytes1\text{ MB} = 2^{20}\text{ bytes}):

Size in MB=6×226220=6×26=6×64=384 MB\text{Size in MB} = \frac{6 \times 2^{26}}{2^{20}} = 6 \times 2^6 = 6 \times 64 = 384\text{ MB}
Final answer

384

Common trap

Forgetting to divide 48 bits by 8 to convert to bytes, or confusing 16 KB with 2162^{16} bytes instead of 2142^{14} bytes.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2016 Computer Science and Information Technology (CS) Session 1
Question
57 of 65, printed as CS Q.47
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.