AI InterviewSearch…Search problems, topics, or pages…Ctrl KGet started
Mediumpagingmemory

~90s

Size of a page table

A system uses 32-bit logical addresses with a page size of 4 KB. How many entries does a single-level page table contain?

Show the answer and the worked solution

Correct answer: C.

2^20 (1 M)

Worked solution

  1. A 4 KB page is 2^12 bytes, so 12 bits of the address are the offset.
  2. That leaves 32 − 12 = 20 bits for the page number.
  3. A page table holds one entry per possible page number, so it has 2^20 (1 M) entries.

Answer: 2^20 (1 M).

The idea

A table of a million entries per process is exactly why real systems use multi-level page tables, inverted page tables or hashed page tables rather than one flat array.

Shortcut. Entries = address space ÷ page size = 2³² ÷ 2¹² = 2²⁰.

Common trap. "2^12 (4 K)" confuses the 12 offset bits of a 4 KB page with the page-number bits; 12 bits index bytes inside a page, not pages.

Size of a page table — OS, DBMS & Networks Aptitude Question

Size of a page table: A system uses 32-bit logical addresses with a page size of 4 KB. Answer and worked solution on CodeKairo.

Question

A system uses 32-bit logical addresses with a page size of 4 KB. How many entries does a single-level page table contain?

Options

  1. 2^12 (4 K)
  2. 2^16 (64 K)
  3. 2^20 (1 M)
  4. 2^32 (4 G)
Show the answer and the worked solution

Correct answer: C. 2^20 (1 M)

Worked solution

  1. A 4 KB page is 2^12 bytes, so 12 bits of the address are the offset.
  2. That leaves 32 − 12 = 20 bits for the page number.
  3. A page table holds one entry per possible page number, so it has 2^20 (1 M) entries.

Answer: 2^20 (1 M).

The idea

A table of a million entries per process is exactly why real systems use multi-level page tables, inverted page tables or hashed page tables rather than one flat array.

Shortcut. Entries = address space ÷ page size = 2³² ÷ 2¹² = 2²⁰.

Common trap. "2^12 (4 K)" confuses the 12 offset bits of a 4 KB page with the page-number bits; 12 bits index bytes inside a page, not pages.

All OS, DBMS & Networks questions · placement mock tests