in Operating System
1,125 views
1 vote
1 vote
Consider a byte addressable virtual memory system with 34-bit addresses where the first 23 bits are used as a page number, and the last 11 bits is the offset. Suppose the system using two-level paging, with first n bits (n>11) of the address used as an index into the first-level page table. Assume that a typical program uses 16MB memory. An expression in terms of n that gives the number of second level page-tables used by the typical program is given by

A  2^24 / 2^(34-n)
B  2^(n-11) x 2^11
C  2^(34-n-11) x 2^11
D  224 / 2^(34-n-11)

Some one please explain what this Question mean?

Answer is given as A
in Operating System
1.1k views

3 Comments

Explanation provided:
First level page table will have 2(34-n-11) x 211 = 2(34-n) bytes. So second level page table will have 16MB/2(34-n) = 224 / 2(34-n) page tables.

0
0

 MIRIYALA JEEVAN KUMA I am not getting it can you please explain it ? :)

0
0

No of entries in first (innermost page table) 2^34/2^11 =2^23 i.e is number of pages.

now 2^23*PTE  ,and try to fit in one page and divide further if it can not fit in one page and now  we do not have PTE and so i am stuck.

now i try to do analysis of  your solution and what i understood

first level page table =innermost page table and now it will have 2^(34-n-11) entries pointing to frame(or page) of size 2^11.

so its size size will be 2^(34-n)byte

second level page table(outermost) will have  16mm/2^(34-n) ------------i  am  not getting it

now I may be completely wrong you please let me know.

0
0

1 Answer

3 votes
3 votes

Consider the division |n|23-n|11|(Keep this in mind.)

The number of bits that have been used in second level page table for indexing pages of the program = 23-n

The size of the program covered by one frame of second level page table = 2^(23-n) * 2^11Bytes

The number of frames required to cover 16 MB of the program = 16MB / 2^(23-n)*2^11

=2^24/2^(34-n).

reference:

http://www.cis.upenn.edu/~lee/03cse380/exam3-v8.pdf

please ignore formatting error if any.Peace!!!!

Related questions

3 votes
3 votes
1 answer
3