A computer uses 46-bit virtual address, 32-bit physical address, and a…
2013
A computer uses 46-bit virtual address, 32-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), which occupies exactly one page. Each entry of T1 stores the base address of a page of the second-level table (T2). Each entry of T2 stores the base address of a page of the third-level table (T3). Each entry of T3 stores a page table entry (PTE). The PTE is 32 bits in size. The processor used in the computer has a 1 MB 16-way set associative virtually indexed physically tagged cache. The cache block size is 64 bytes.
What is the size of a page in KB in this computer?
- A.
2
- B.
4
- C.
8
- D.
16
Attempted by 5 students.
Show answer & explanation
Correct answer: C
Concept
In a hierarchical (multi-level) page table, the virtual address splits into a page offset plus one index field per level. If the page size is 2P bytes, the offset uses P bits. A table that "occupies exactly one page" must therefore fit in 2P bytes, so the number of entries it can hold is the page size divided by one entry's size. Since every entry stores a base address / PTE of 32 bits = 4 bytes, a one-page table holds 2P / 4 = 2P−2 entries, i.e. each level it feeds consumes (P − 2) index bits.
Application
Let the page size be 2P bytes; the page offset is P bits.
The virtual address is 46 bits, so the bits used for paging (the Virtual Page Number) are 46 − P, split across the three levels T1, T2, T3.
T1 occupies one page and each entry is 4 bytes, so T1 has 2P / 4 = 2P−2 entries → the T1 index needs (P − 2) bits. T2 and T3 are each one page of the same 4-byte entries, so each of those levels is indexed by (P − 2) bits as well.
Add the three index fields and set them equal to the VPN bits: (P − 2) + (P − 2) + (P − 2) = 46 − P, i.e. 3(P − 2) = 46 − P.
Solve: 3P − 6 = 46 − P → 4P = 52 → P = 13.
Page size = 213 bytes = 8192 bytes = 8 KB.
Cross-check
With P = 13, each level supplies P − 2 = 11 index bits, so three levels give 3 × 11 = 33 bits, plus the 13-bit offset = 46 bits = the full virtual address. The split is consistent, confirming the page size is 8 KB. (The cache details — 1 MB, 16-way, 64-byte blocks — belong to a companion part of this problem and are not needed to size the page.)