3,584 views
1 votes
1 votes
If we are given PAGE SIZE=4KB, PAGE TABLE ENTRY SIZE=4B OUTER PAGE TABLE SIZE=4KB and levels of Paging=3 ,so how to go about calculating the virtual address space .

3 Answers

Best answer
2 votes
2 votes

No. of entries in outer page table = 4KB/4B = 1024, so 10 bits for this.

Now, we can't directly go to level 2, so lets go to final level.

In final level we need a page table entry for each page. Let the virtual address space be $2^p$, so no. of entries will be $\frac{2^p}{\text{page size}} = \frac{2^p}{4 \times 2^{10}} = 2^{p-12}$.

Now, these entries are spread across different tables. We are not sure how many of these entries are going to 1 third level page table. For this, lets assume a third level page table takes size of a page- 4KB. 

Now, no. of entries in a SINGLE third level page table $= 4KB/4B = 2^{10}$. So, no. of third level page tables $= \frac{2^{p-12}}{2^{10}} \\=2^{p-22}$. 

Now, we need second level PTE for each of these third level page tables. i.e., sum of PTEs in second level $=2^{p-22}$. 

Again lets assume a second level page table takes size of a page- 4KB. 

Now, no. of entries in a SINGLE second level page table $= 4KB/4B = 2^{10}$. So, no. of second level page tables $= \frac{2^{p-22}}{2^{10}} \\=2^{p-32}$. 

Now, we need an entry in first level page table for each of these second level page table and there is only 1 first level page table. We already got this is 1024 in our first step. So, 

$2^{p-32} = 2^{10} \\ \implies p-32 = 10 \implies p = 10 + 32 = 42.$

So, size of virtual address space $ = 2^{42}$ bytes. 

But don't forget the size of page tables we assumed during calculation - this might be different in other questions. 

selected by
0 votes
0 votes

Let LA  = p bits

As we know Page Table size = Number of entry * Page table entry Size

1.Level 3 PTS = 2p/212 * 4 =   A

2.Level 2  PTS= A/212*4 = B

3.Level 1 PTS = B/212*4 = 212

therefore B = 222
Now put the value of B in equation 2  A = 2
32
Now put the value of A in equation 1  2P = 242

LA = P bits = 42


 

 

0 votes
0 votes
No of entries in outer page table =Page size/Page table size =k (2^10Bytes)

Now these entries will point to pages in which the inner page table2 is actually divided therefore no of entries in outer page table implies the no of pages in which we divide the inner page table2 and it is equal to K.

Now in each page of inner page table2 , we will have same 2^10 entries ,therefore in total we will have K*K entries coming out from inner page table 2 and these many entries are actually the no of pages in which we have divided the innermost page table 3, and therefore no of pages in which innermost page table 3 is paged is K*K , now in each page I shall have again K entries therefore total K*K*K entries would be coming out from innermost page table 3 and it is actually equal to no of pages in which my process would be divided therefore no of pages in virtual address space is K*K*K and each page is of size 4KB therefore virtual address space =2^30*2^12 Bytes =2^42 Bytes hence no of bits in virtual address =42 bits

Related questions

2.6k
views
2 answers
2 votes
radha gogia asked Sep 13, 2015
2,585 views
A hard disk has 63 sectors/track ,10 platters each with 2 recording surfaces and 1000 cylinders ,the addressof each sector is given aswhere C is cylinder no , H ... address as and so on , so then the address corresponds towhich sector no ?
11.1k
views
2 answers
2 votes
radha gogia asked Sep 13, 2015
11,102 views
A disk pack has 19 surfaces and storage area on each surface has an outer diameter of 33cm and inner diameter of 22cm .The maximum recording storage density on any ... tracks is 0.25 mm , then how to calculate the capacity of disk pack ?
618
views
0 answers
0 votes
radha gogia asked Aug 23, 2015
618 views
The sum of money in kept in a bank amounts to 1240 in 4 yrs and Rs 1600 in 10 yrs at Simple interst . then how to find sum ?I formed an AP 1240= a+(4-1)d 1600= a+(10-1) d but I am nt getting the answ where is my mistake ?