edited by
3,417 views

2 Answers

Best answer
4 votes
4 votes

size of logical address space is  32 MB = 25 * 220  B =  2 25  Bytes

size of physical address sapace is  256 KB = 28 * 210 B = 218 Bytes

page size is 4 KB = 22 * 210 B = 212 Bytes 

When we divide physical memory into a number of equal size blocks, it called Frames.

When we divide a programs logical memory space into a blocks of same size, it is called pages.

so the number of pages = 225  / 212 

= 213

= 8,192

The number of pages in the system is 8,192.

selected by
3 votes
3 votes

Given, LAS=32MB=225B, PAS=256KB=218B and Page size=4KB=212B.

No. of pages in the process=$\frac{Process Size}{Page Size}$= $\frac{2^{25}}{2^{12}}$= 213 pages.

So, no. of entries in the innermost Page Table, say PT1 =213 entries.

Size of PT1=213 x PTE size.

Since PTE size is not given, assume it to contain only frame number bits. Total no of frames in Physical memory=$\frac{2^{18}}{2^{12}}$=2frames. So frame no bits=6 bits.

Size of PT1 =213x6 bits=$\frac{2^{13}\times 6}{2^{3}}$ B=  6x210 B > Page size. So we go for another page table, say PT2 .

No of entries in PT2  = No of pages of PT=$\frac{PT1 Size}{Page Size}$=$\frac{6\times 2^{10}}{2^{12}}$=$\left \lceil 1.5 \right \rceil$=2. So we need 2 pages for PT1

Size of PT=2x6 bits=12/8 B=1.5B<Page size. So we need 1 page for storing PT2 .

No of pages in the system=No of pages of the process + No of pages of PT1 + No of pages of  PT2

=213+2+1=8192+2+1=8195.

Please correct me, if I am wrong.

edited by
Answer:

Related questions

0 votes
0 votes
1 answer
3
2 votes
2 votes
2 answers
4