We do the multi-level paging because of the
PAGE TABLE SIZE > PAGE SIZE or FRAME SIZE,
we need to do this because while doing the address translation the
PAGE TABLE ALSO NEEDS TO BE IN THE MAIN MEMORY, i.e in one of the frame of the main memory.
so that's why the page must fit in a single frame.
Now as we do the multilevel paging we will go up to 3 levels of paging..
1)# of pages in VAS=2^30 pages so the first page table (PT1) will also have this many pages and each page table entry is of size 2B.
therefore, the PT1 SIZE=2^31 >> than the page size, so we need to perform paging again.
2)How many pages we should divide the PT1, PT1=(PT1 size)/page size therefore 2^17 pages and again each page table entry is of size 2B. therefore PT2 SIZE=2^18 >> than the page size, so we need to perform paging again.
3)How many pages we should divide the PT2, PT2=(PT2 size)/page size therefore 2^4 pages and again each page table entry is of size 2B. therefore PT3 SIZE=2^5 << than the page size, so we there is no need to perform paging again. as we can fit the page table into single page.
correct me if i am wrong:)