GATE / CS ARCHIVE

SIMILAR QUESTIONS / OPERATING SYSTEMS

Count flat page table entries and storage

3 questions solved the same way, newest first. Back to Operating Systems

How these are solved

Derive virtual page count by removing page-offset bits; multiply by explicitly supplied PTE bytes when storage is requested. 2015/2016 ask table bytes with different widths;

1 mark · MCQ
Report issue

Sizing a virtual page table

Virtual Memory & Paging

Question 14, GATE 2025: A byte-addressable demand-paged machine has 32-bit logical addresses, 20-bit physical addresses, and 2048-byte pages. What is the maximum number of entries in a conventional page table? A 2^21; B 2^20; C 2^22; D 2^24.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Step through it (5 steps)

Approach: Count virtual pages, because a conventional page table has one possible entry per virtual page.
The page size is 2048=211 bytes, so the low 11 bits of a logical address identify a byte within its page. The remaining 32−11=21 bits identify the virtual page. There are therefore 221 possible virtual-page numbers, selecting A.
Equivalently, the virtual address space has 232 bytes and dividing by 211 bytes per page gives 221 pages. Physical-address width is not the numerator in this calculation. It determines that physical memory can contain 220−11=29 frames and that a frame number needs 9 bits.
Demand paging may leave many entries invalid or pages absent from physical memory, but that does not reduce the maximum number of distinct virtual pages the table must represent.

Original paper, page 14 · Answer key

2 marks · NAT
Report issue

Virtual Memory & Paging

Question 47, GATE 2016: A system has 40-bit virtual addresses,16-kilobyte pages and a one-level page table per process. Each entry occupies 48 bits. Find the per-process page-table size in megabytes, using binary memory units.
Tap to enlarge
Answer & solution

Official answer: 384.0 : 384.0

Our answer: 384

Step through it (6 steps)

A16 KiB page uses 14 offset bits, leaving 40−14=26 virtual-page bits. There are 226 page-table entries, each 48 bits=6 bytes, totaling 6*226 bytes=384 MiB. The official answer uses binary kilobyte/megabyte conventions and excludes unspecified table metadata.

Page-table storage depends on the number of virtual pages, not the physical RAM capacity, which is not given. Offset bits are log 2(16×1024)=14; the remaining 26 bits index 226 entries. Convert the 48-bit entry into 6 bytes before multiplying. The product 402653184 bytes divided by 220 bytes per MiB is 384. Confusing 48 bits with 48 bytes would inflate the answer by a factor 8.

Original paper, page 18 · Answer key

1 mark · NAT
Report issue

Virtual Memory & Paging

Question 29, GATE 2015: Byte-addressable memory has 32-bit logical addresses, 4-kilobyte pages, and 4-byte page-table entries. Find the single-level page-table size in megabytes.
Tap to enlarge
Answer & solution

Official answer: 4

Step through it (6 steps)

There are 232 addressable bytes and 212 bytes per page, so the virtual address space contains 220 pages. Each needs one entry even though physical memory size is not given. Multiply entries by bytes per entry: 220×4=222 bytes=4 MiB. The question labels binary MiB as MB; the answer is not the page size itself.

Solution: A4 KiB page uses 12 offset bits, leaving 20 page-number bits in a 32-bit address. A single-level table needs 220 entries of 4 bytes, totaling 222 bytes=4 MiB. Thus4 under the question’s binary MB convention.

Original paper, page 11 · Answer key