edited by
5,101 views
3 votes
3 votes
A computer has 32-bit virtual addresses and 4-KB pages. The program and data together fit in the lowest page (0-4095). The stack fits in the highest page.  How many page table entries are needed for two-level paging, with 10 bits in each part?
edited by

3 Answers

1 votes
1 votes

2M total page table entries will be there

10 bits each means 10 bits each for outer and inner page tables .
ie
Out 32 bit  Virtual Address 12 bits are used as page offset remaining is 20 bits
Out of this 20 bits 10 bits each is used for each level of paging .

0 votes
0 votes
as question says it implements 2 level paging,out of 32 bits 12 bits are used for page size,remaining 20 bits are used for first and second level paging.(10 for each).
0 votes
0 votes

The program and data toget­her fit in the lowest page (0-4095) The stack fits in the highest page.

means they will only occupy one frame since frame size is 4KB.so one entry is for this page in first level

and stack occupy highest page so one more entry for stack,as only required pages are brought in memory.

so total 2 entries in first level page table

So, while the total number of page table entries is 1048576, of those you only use 2 entries, one for each of those 2 pages (entry 0 points at the code/data page and entry 1048575 points at the stack page)

see pc diagram above for more clarification of what i am saying..

but for two level paging there will be 2 more entries for two first level pages i mentioned above

for more detailed https://stackoverflow.com/questions/12485737/oper-systems-and-memory-management-theoretical

Related questions

0 votes
0 votes
2 answers
1
Unique_999 asked Aug 17, 2023
320 views
Can Any explain the relationship between The “ Word Size “ and “ Logical Address Space “
1 votes
1 votes
2 answers
3
Aks9639 asked Sep 10, 2018
1,435 views
Consider a system using 2 level paging applicable page table is devided into 2k pages each size 4kB. If PAS is 64 MB which is devided into 16K frames . PTE size is 2B in...
2 votes
2 votes
2 answers
4
amIndian asked Dec 30, 2017
882 views
A system support 32 bit virtual address with a page size of power of 2. Page table entries 32 bit wide. The page size in KB of the system should be ____ in order to make ...