Question

Consider a system with byte-addressable memory, 32-bit logical addresses, 4 kilobyte4\text{ kilobyte} page size and page table entries of 4 bytes4\text{ bytes} each. The size of the page table in the system in megabytes is _____.

Official answer and solution
Official answer
4
From
Official GATE 2015 answer key

Solution

Calculate the number of virtual pages and multiply by the page table entry size to determine total page table size.

Given parameters:

  • Logical address space: 32 bits  ⟹  232 bytes32\text{ bits} \implies 2^{32}\text{ bytes}.
  • Page size: 4 KB=4×210 bytes=212 bytes4\text{ KB} = 4 \times 2^{10}\text{ bytes} = 2^{12}\text{ bytes}.
  • Page Table Entry (PTE) size: 4 bytes4\text{ bytes}.
  1. Number of pages in the logical address space:
textNumberofpages=232212=220 pages.\\text{Number of pages} = \frac{2^{32}}{2^{12}} = 2^{20}\text{ pages}.
  1. Total size of the single-level page table:
textPageTableSize=220 entries×4 bytes/entry=4×220 bytes.\\text{Page Table Size} = 2^{20}\text{ entries} \times 4\text{ bytes/entry} = 4 \times 2^{20}\text{ bytes}.

Since 1 MB=220 bytes1\text{ MB} = 2^{20}\text{ bytes}:

textPageTableSize=4 MB.\\text{Page Table Size} = 4\text{ MB}.

In megabytes, the answer is 44.

Final answer

4

Common trap

Dividing physical memory size instead of logical address space to calculate the number of page table entries.

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

Source

Paper
GATE 2015 Computer Science and Information Technology (CS) Session 1
Question
22 of 65, printed as CS Q.12
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.