edited by
75,699 views
276 votes
276 votes

A processor uses $36$ bit physical address and $32$ bit virtual addresses, with a page frame size of $4$ Kbytes. Each page table entry is of size $4$ bytes. A three level page table is used for virtual to physical address translation, where the virtual address is used as follows:

  • Bits $30-31$ are used to index into the first level page table.
  • Bits $21-29$ are used to index into the 2nd level page table.
  • Bits $12-20$ are used to index into the 3rd level page table.
  • Bits $0-11$ are used as offset within the page.

The number of bits required for addressing the next level page table(or page frame) in the page table entry of the first, second and third level page tables are respectively

  1. $\text{20,20,20}$
  2. $\text{24,24,24}$
  3. $\text{24,24,20}$
  4. $\text{25,25,24}$
edited by

14 Answers

0 votes
0 votes

Here what I want to know is what is the total size required by the page tables?
My explanation: Number of frames : 2^36/2^12=2^24 , now each third level page table can address 2^9 , so total number of third level page tables required to address PA is 2^24/2^9=2^15
Now we have 2^15 entries in the second level page tables , but each second level page table can adres 2^9 pages , so 2^15/2^9 =64 page tables for second level
Now 4 entries per first level PT , and we must address 64 entries for the first level , so 64/4 = 16 first level page tables
------------------------------------------------------------------------------------
Is the above explanation correct?
So : Number of first level PTs=16
Number of scnd level PTs=64
Number of third level PTs=2^15

Am I crct in the abve explanation or is there something wrng?

@Arjun Sir @Praveen Saini Sir plz have a look ! Thank you!

0 votes
0 votes

The question given is wrong, 

The question should be 36 bits in the virtual address and 32 bits in the Physical address and if this was the condition then option  B (24,24,24 )is right.

WHY THIS QUESTION IS WRONG???

if you do according to the right procedure you will find that the way they have allocated the bits in the Logical address for page table indexing is wrong :

Allow me to clarify it:

let us say 1st level means outermost page table. and 3rd  level means innermost page table.

and we know that page size= frame size = 4kb= 12 bits in page offset or frame offset  field 

Since virtual  address space is 32 bits then 

 

no of pages= (2 ^ 32 ) / page size  = (2 ^ 32) / 4 kB = (2 ^ 20) = 2 M

for the innermost level or says at 3rd level: page table size =

(2^ 20 ) * 4 BYTE =   4 MB which is greater than page size and it can't fit in one frame so we have to again do paging. // 4 B is page table entry size they have given it.

for the second level

No of page table entry  = 4 MB / 4 KB = 1 K pages and size of the page table for the second level is 1k *4B= 4 KB which is equal to page size, it means now we don't need any other LEVEL. Two level paging is enough for this question

to allocate bits, divide the virtual  memory as 

Total bits = 32 

for innermost we need 10 bits because it is completely filed and for outermost page table we need 10 bits and for page offset, we need 12 bits.

1.NEVER divide physical address into pages, it can be divided only in two field  Frame no  and frame offset

2.Don't attempt any wrong question in gate they are going to give marks to everyone who is not attempted.

 

 

 

0 votes
0 votes

Correct B only...the frame size is of 24 bit .. irrespective of levels the frame number should be same 24 bit only..

 

 

0 votes
0 votes
How I solve this as-

question is asking for frame bits.

physical address bits are = 36, which contains both frame number bits as well as frame offset bits.

frame size = page size = 4KB ( means 12 bits are of frame offset)

so frame bits required = 36 – 12 = 24 buts remaing for frame number.
Answer:

Related questions

51 votes
51 votes
7 answers
1
29 votes
29 votes
3 answers
2
Kathleen asked Sep 12, 2014
16,901 views
A process executes the following codefor(i=0; i<n; i++) fork();The total number of child processes created is$n$$2^n-1$$2^n$$2^{n+1} - 1$
23 votes
23 votes
4 answers
4