Skip to main content

GATE CSE 2023Operating System › Memory Management & Virtual MemoryVerified

GATE CSE 2023 PYQ: Consider a computer system with 57 57 57 -bit virtual addressing using multi-level tree-structured page…

Consider a computer system with 57-bit virtual addressing using multi-level tree-structured page tables with L\mathrm{L} levels for virtual to physical address translation. The page size is 4 KB(1 KB=1024 B)4 \mathrm{~KB}(1 \mathrm{~KB}=1024 \mathrm{~B}) and a page table entry at any of the levels occupies 8 bytes.

The value of L\mathrm{L} is ______________.

    Answer

    5

    Approach

    Compute the virtual page number (VPN) bits, then compute how many page-table indices fit in one page. Each level consumes that many VPN bits, so the number of levels is the ceiling of VPN bits divided by bits per level.

    The 57-bit virtual address has 45 VPN bits. Since one page table page can store $2^9 = 512$ entries, each level consumes 9 bits of the VPN. Exactly five such levels are needed to cover all 45 bits, so L = 5.

    Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.