edited by
7,114 views
3 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?

3 Answers

1 1 vote

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 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 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

Position:
Show:

Related questions

0 0 votes
0 0 answers
365
365 views
Ved_Prakash_Verma asked Sep 5, 2024
365 views
A Machine has a 32-bit Address Space and an 8KB Page. The PageTable is entirely in hardware, with one 32-bit word per entry.When a Process starts, the Page Table is copie...
0 0 votes
2 2 answers
681
681 views
Unique_999 asked Aug 17, 2023
681 views
Can Any explain the relationship between The “ Word Size “ and “ Logical Address Space “
0 0 votes
1 1 answer
1.3k
1.3k views
Lovejeet Singh asked Oct 17, 2018
1,301 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 not be able t...
1 1 vote
2 2 answers
2.3k
2.3k views
Aks9639 asked Sep 10, 2018
2,343 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...