edited by
1,054 views
0 votes
0 votes
A system that uses a two-level page table has $2^{12}$ – byte pages and $32$ – bit virtual addresses. The first $8$ – bits of the address serve as the index into the first level page table. The number of  bits specify the second level index is ________
edited by

3 Answers

Best answer
1 votes
1 votes

12 bits is the answer

as it is given that page size is 212  Bytes , so 12 bits are needed to specify that offset

 The number of  bits specify the second level index is :

32 - ( 12 + 8 )

= 32 - 20

= 12

4 votes
4 votes

Multilevel paging works by dividing the virtual address in a number of index pits and a page offset.

For a 2-level paging system, we partition the virtual address (logical address) as follows:

                  $p_1$                      $p_2$                   offset

It is given that page size is $2^{12}$ bytes. So, the offset should be of 12 bits. 

The virtual address is given of 32 bits, and first 8 bits serve as the index into the first level page table. 

so, offset = 12 bits, $p_1$ = 8 bits and total address is 32 bits. Asked $p_2$ = ?

                  8                     ?                12

32 = 8 + ? + 12

=> ? = 12

So, answer should be 12 bits.

0 votes
0 votes

1] Hierarchical Paging

  • It is also called Multilevel Paging and it is a very simple methodology.
  • When the page table is too big to fit in a contiguous space then this hierarchical paging system is used with several levels.
  • In this, the logical address space is broken up into Multiple page tables.
  • Hierarchical paging uses the following two types of page tables:
    • Two-Level Page Table
    • Three-Level Page Table

Two Level Page Table:

  • On this page table, itself is paged. Therefore, here two-page tables' inner page table and outer page table are present.
  • Example: 32-bit logical address space and a page size of 4 KB is divided into A Page Number consisting of 20 bits and A Page Offset consisting of 12 bits.
  • Since the Page table itself paged, the page number is further divided into, A 10-bit page number and A 10-bit page offset.

Therefore Logical Address looks as follows:

P1 P2 d
10 10 12
Outer Page Table Inner Page Table Offset

2-LEVEL PT

Suppose the question asked 

P1 P2 d
8 ? 12
Outer Page Table Inner Page Table Offset

Note that p1 is the first level index which is the outer level Here with terminology you can find difficulty but take time to understand it 

Now the  the  Outer Level is pointer to the inner table  ; note that each of the of page 

0 , 1, 2 ,3 ,4 …. 2^8-1 is mapping to the each page table 

For example

Outer page table of 

0th page is pointing to the inner page table which we will have 2^12 entries of page table

1th page is pointing to the inner page table which we will have 2^12 entries of page table

2th page is pointing to the inner page table which we will have 2^12 entries of page table

so on

2^8 -1 th page is pointing to the inner page table which we will have 2^12 entries of page table

Now the Inner table of  0th page which have entries of 2^12 each entries is pointing to the page table of 2^12 in the virtual memory 

the Inner table of  1th page which have entries of 2^12 each entries is pointing to the page table of 2^12 in the virtual memory 

so on 

the Inner table of  2^8- 1 th   page which have entries of 2^12 each entries is pointing to the page table of 2^12 in the virtual memory 

This is the idea of Two level paging Hope You understand.

Answer:

Related questions

2 votes
2 votes
3 answers
1
Bikram asked Dec 26, 2016
1,031 views
In a paged memory, the page hit ratio is $0.35$. The time required to service the page fault is $100$ ns. Time required to access a page in primary memory is $10$ ns.The ...
1 votes
1 votes
1 answer
3