edited by
5,431 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

380
views
2 answers
0 votes
Unique_999 asked Aug 17, 2023
380 views
Can Any explain the relationship between The “ Word Size “ and “ Logical Address Space “
657
views
1 answers
0 votes
Lovejeet Singh asked Oct 17, 2018
657 views
Why do we need multilevel paging?According to me the reason is that page table needs contiguous memory allocation.So if page table size is too large, we may ... we store all levels page table in memory or only the outer level page table?
1.5k
views
2 answers
1 votes
Aks9639 asked Sep 10, 2018
1,523 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 ... the levels calculate the length of PA, LA and # of entry at second level?
926
views
2 answers
2 votes
amIndian asked Dec 30, 2017
926 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 sure that the page table fits exactly in one frame of memory.