retagged by
858 views
0 votes
0 votes
Suppose you have a computer system with a $48-bi$t logical address, page size of $16K$ and $4 bytes$ per page table entry. If we have a $48MB$ program such that the entire program and all necessary page tables are in memory. How much memory is used by program, including its page tables?
retagged by

1 Answer

1 votes
1 votes

Total memory requirements of 48 MB of program = 48 MB (program's usage in physical memory) + Page table entries corresponding to pages for 48 MB


Considering 1 level paging-

p | d = 34 | 14
#Pages required for 48 MB in logical space=48 MB/16K =3145.728 =~3146

Page table entries corresponding to 3KB pages=3146*4=12.28KB

Total=48MB +12.28KB=48.01MB


On the other side, there is a catch in question-- "all necessary page tables are in memory"

This means we should consider multilevel paging here -

Logical address' bits will be paged as- p1 | p2 | p3 | d = 10 | 12 | 12 | 14  [considering outermost page table fits in single page size]

A page table is stored in a page i.e 2^14, but since each entry requires 4 bytes, so effectively #pages in one table=2^14/4=2^12 

We have 3146 pages, so total page tables needed in the third level=3146/2^12=0.76 =~1 page table

To point 1 page table of third level, #page table needed in the second level=1 page table

To point 1 page table of second level, #page table needed in the first or outermost level=1 page table

Total page tables needed=3

Total memory acquired by 3 page tables=3*2^14=48KB

Total memory needed by program=48MB+48KB=48.046MB

edited by

No related questions found