Suppose that a machine has 38-bit virtual addresses and 32-bit physical addresses.
(b) With a two-level page table, 16-KB pages, and 4-byte entries, how many bits should be allocated for the top-level page table field and how many for the next level page table field? Explain.
And here's the answer:
The offset field requires 14 bits to address 16 KB. That leaves 24 bits for the page fields. Since each entry is 4 bytes, one page can hold 16KB / 4 byte = 2^12 page table entries and therefore requires 12 bits to index one page. So allocating 12 bits for each of the page fields will address all 2^38 bytes.
I don't quite understand if we have offset 14 bit which is used to address within the page, then what is one page can hold 16KB / 4 byte = 2^12 ? Another offset?