Skip to content
Official PYQ · 2013

GATE CS 2013 Q52 — Memory Management and Virtual Memory

Explain with AI

A computer uses 46-bit46\text{-bit} virtual address, 32-bit32\text{-bit} physical address, and a three–level paged page table organization. The page table base register stores the base address of the first-level table (T1)\text{(T1)}, which occupies exactly one page. Each entry of T1\text{T1} stores the base address of a page of the second-level table (T2)\text{(T2)}. Each entry of T2\text{T2} stores the base address of a page of the third-level table (T3).\text{(T3)}. Each entry of T3\text{T3} stores a page table entry (PTE).\text{(PTE)}. The PTE\text{PTE} is 3232 bits in size. The processor used in the computer has a 1  MB  161\;\textsf{MB}\; 16 way set associative virtually indexed physically tagged cache. The cache block size is 6464 bytes.

What is the size of a page in KB\textsf{KB} in this computer?

Choose one option
View worked solution

Answer: C

Let the page size be 2p2^p bytes. Thus, the page offset requires pp bits.

Since the virtual address is 4646 bits, the Virtual Page Number (VPN) has 46−p46 - p bits. This VPN is split into three parts for the three-level page table: d1d_1 bits for T1\text{T1}, d2d_2 bits for T2\text{T2}, and d3d_3 bits for T3\text{T3}. Therefore:

d1+d2+d3=46−pd_1 + d_2 + d_3 = 46 - p

The size of a Page Table Entry (PTE) is 32 bits=4 bytes=22 bytes32\text{ bits} = 4\text{ bytes} = 2^2\text{ bytes}. Assuming the entry size at all levels of the page table is 44 bytes:

  • Since T1\text{T1} occupies exactly one page, its size is 2p2^p bytes. The number of entries in T1\text{T1} is 2d1=2p4=2p−22^{d_1} = \frac{2^p}{4} = 2^{p-2}, which gives d1=p−2d_1 = p - 2.
  • Similarly, to index a single page of the next level table, we have d2=p−2d_2 = p - 2 and d3=p−2d_3 = p - 2.

Substituting these values into the VPN equation:

(p−2)+(p−2)+(p−2)=46−p(p - 2) + (p - 2) + (p - 2) = 46 - p 3p−6=46−p3p - 6 = 46 - p 4p=52  ⟹  p=134p = 52 \implies p = 13

Thus, the page size is 213 bytes=8 KB2^{13}\text{ bytes} = 8\text{ KB}.

Note: The cache details provided in the question are extra information and not required to solve for the page size.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Memory Management and Virtual Memory questions