in Operating System closed by
1,821 views
0 votes
0 votes
closed with the note: Poorly Framed Question
Consider a system which has 2 level paging.The page table is divided into 2K pages and each page is having 4K entries.Memory is word addressable and Physical address space is 64MW which is divided into 16K frames.Page table entry size is 2 words.

(A)Length of logical address

(B)Length of physical address

(C)$1^{st}$ level page table size

(D)one $2^{nd}$ level page table size

 

My Work

Page table of process is divided into 2K pages, means at second level we have 2K pages.So, this means we should have 2K entries at the first level page table and hence number of bits to index first level page table should be $p_1=log_2(2K)=11$

Each page has $4K$ entries and each such entry size is $2$ words.So, Page size must be $8KW$.Since, at second level, each page table is represented by a page, and each such page has $4K$ entries,so number of bits needed to index second level page table

$p_2=log_2(4K)=12$

Page Size=$8KW=2^{13}words \rightarrow d(page\,offset\,bits)=13$

Physical Address space=$64MW=2^{26}$

$f+d=26$

so $f=13$

But number maximum frames are given to be 16K and this isn’t consistent with result what I am getting.

Is question poor or I am poor at multi-level paging?(Please tell where I went wrong)
in Operating System closed by
1.8k views

4 Comments

Same here, some data doesn't agree. Since PAS is 64MW and number of total frames is 16K, then frame size is: $2^{26}/2^{14}$ = $2^{12}W$. So page size will also be  $2^{12}W$.
Now number of entries per page = $4K i.e. 2^{12}$, so size of entry will be $2^{12}/2^{12}$ = $1W$. Doesn't agree with what's given in the problem.
0
0

@Ayush Upadhyaya 

I worked it out this way :

The page table is divided into 2^11 pages and each page has 2^12 entries.

So total page table entries are: 2^11*2^12=2^23

It is given to us that Physical address space is 64MB and frame size is:2^26/2^14=2^12. So page size is 4 kb.

So size of the first page table is = 2^23*2(as PTE size is 2 bytes)=2^24.

So no of pages needed for this page table are: 2^24/2^12=2^12.. but it is given that no of pages is 2^11 Contradiction.

 

 

0
0
I am not getting what data given in the question is wrong.
0
0
Yes poor question.
0
0

Related questions