Given : VAS = 38 bits,
Let page size consists of ‘d’ bits.
Here we can assume that each page table MUST fit into a frame as told by Bikram Sir, it implies that irrespective of which level’s page table we are referring to, the page table size must get fit into a frame. We will consider the best case which is we must remove internal fragmentation which is caused by paging, so we take page table size = frame size rather than page table size <= frame size. As we know that frame size = page size (by default). So, by transitivity page table size = page size.
Here, we are asked to use 3 level paging. So, considering the outer level page table, the Size of the outer page table = frame size = page size, where page size = 2^d. Ultimately, outer page table = 2^d bytes.
Size of outer page table = number of pages x size of page entry, computing which we get
The number of pages in the outer table = 2^(d – 2).
Now, considering the 2nd level page table, the Size of the 2nd page table = frame size = page size, where page size = 2^d. Ultimately, 2nd page table = 2^d bytes.
Size of 2nd page table = number of pages x size of page entry, computing which we get
The number of pages in the 2nd table = 2^(d – 2).
Further moving on to the inner level page table, its size too would be considered equivalent to 2^d bytes because each page table MUST fit into a frame. So, the inner page table = 2^d Bytes.
Size of inner page table = number of pages x size of page entry, computing which we get
Number of pages in inner table = 2^(d – 2).
Summing up, we get the total size of 3 level paging as 2^(d-2) x 2^(d-2) x 2^(d-2) = 2^(3d – 6) number of pages, consider this is as equation 1.
The total number of pages in the page table :
Size of VAS/ page size = 2^38/2^d = 2^(38 – d), consider this is as equation 2.
On comparing the powers of equation 1 and equation 2,
3d – 6 = 38 – d
4d = 44
d = 11 bits.
So, page size = 11 bits, which is equal to 2 KB.
Hope it helps.