edited by
5,604 views
1 votes
1 votes

In a 32-bit machine we subdivide the virtual address into 4 segments as follows: 
 

10-bit

8-bit

6-bit

8 bit

We use a 3-level page table, such that the first 10-bit are for the first level and so on.

What is the size of a page table for a process that has 256K of memory starting at address 0?

(assume 2Byte per entry for all the levels)

edited by

2 Answers

Best answer
5 votes
5 votes
Since the last 8 bits of the virtual address denote the page offset, we can find that page size is $2^{8}$ bytes.

Total memory is 256KB. So number of pages is $\frac{2^{18}}{2^{8}}=2^{10}=1024$.

The first 10 bits of virtual address means, we have $2^{10}=1024$ entries in the outer page table. Similarly, next 8 bits in the virtual address help us to find that there are $2^{8}=256$ entries in the second level page table, and next 6 bits in the virtual address shows us that there are $2^{6}=64$ entries in the third level page table.

Size of a page table entry is 2 bytes for all levels.

The outer page table points to 1024 entries in the second level page table each of whcih points to 256 entries in the third level page table each containing 64 pages. The process's address space consists of 1024 pages. So we need 16 third level page tables (Here, the third level page table has only 64 entries and we need to point to 1024 pages. That's why!). Thus the page table size can be calculated as:

$(1024*2)+(256*2)+(16*64*2)=4608$ bytes.
selected by

Related questions

0 votes
0 votes
0 answers
2
SSR17 asked Feb 8
206 views
we have 8 pages (each side 32B) to store in physical memory of 2^32 bits how many bits are required to identify each page , according to me 3 bits are required but that i...