0
$\begingroup$

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$

That means maximum frames must be $2^{13}=8K$, but question mentions it's 16.

Have I done anything wrong or the question is poorly framed?

$\endgroup$

1 Answer 1

1
$\begingroup$

your approach is right however some maths isn't making sense in the question itself. for example, we have 4k entries in each page table, each of this entry is 2 W long so total space of a page should be 8K words.

And we got 16K frames in MM whose size is 64MW, thereby the size of each frame should be 2^(26-14)=2^12 word= 4kW

Since the frame size and page size should always be equal but in this particular case the frame size is different than page size hence it could be said that question itself is wrong.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.