A Computer system implements 8 kilobyte pages and a 32-bit physical address…

2015

A Computer system implements 8 kilobyte pages and a 32-bit physical address space. Each page table entry contains a valid bit, a dirty bit three permission bits, and the translation. If the maximum size of the page table of a process is 24 megabytes, the length of the virtual address supported by the system is _______________ bits?

Attempted by 146 students.

Show answer & explanation

Correct answer: 36

Page/offset facts

  • Page size = 8 KB = 2^13 bytes ⇒ offset = 13 bits

Physical frame number (PFN) bits in PTE

  • Physical address = 32 bits

  • Offset = 13 bits ⇒ PFN bits = 32 − 13 = 19

PTE size

  • Fields: valid (1) + dirty (1) + permissions (3) + PFN (19)

  • Total = 1 + 1 + 3 + 19 = 24 bits = 3 bytes per PTE

Max page table size ⇒ number of entries

  • Max page table size = 24 MB = 24 × 2^20 bytes

  • Number of PTEs = (24 × 2^20) / 3 = 8 × 2^20 = 2^23

  • So, number of virtual pages = 2^23 ⇒ VPN bits = 23

Virtual address length

  • Virtual address bits = VPN bits + offset bits = 23 + 13 = 36 bits

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir