edited by
68,743 views
49 votes
49 votes

Consider a machine with $64$ MB physical memory and a $32$-bit virtual address space. If the page size s $4$ KB, what is the approximate size of the page table?

  1. $\text{16 MB}$
  2. $\text{8 MB}$
  3. $\text{2 MB}$
  4. $\text{24 MB}$
edited by

4 Answers

Best answer
72 votes
72 votes
Number of pages $= 2^{32} / 4KB = 2^{20}$ as we need to map every possible virtual address.

So, we need $2^{20}$ entries in the page table. Physical memory being $64 \ MB$, a physical address must be $26$ bits and a page (of size $4KB$) address  needs $26-12 = 14$ address bits. So, each page table entry must be at least $14$ bits.

So, total size of page table $= 2^{20} \times 14 \ bits ≈ 2 \ MB$ (assuming PTE is $2$ bytes)

Correct Answer: $C$
edited by
28 votes
28 votes
Physical memory $=64MB=2^{26} B $

Size of frame$ =4KB =2^{12}B$

No. of frames $=  $physical memory/size of frame$ = \frac{2^{26}B}{2^{12}B}=2^{14}$

Frame number $=14 bits$

Virtual memory $=32 bits =2^{32}B$

Size of page $=$size of frame $=4KB =2^{12}B$

No. of pages$ =$virtual memory/size of page $=\frac{2^{32}B}{ {2^{12}B}} =2^{20} $

size of page table$=$Number of pages $\times$Size of each entry

size of page table$=$Number of pages $\times$Page table entry

size of page table$=$Number of pages $\times$Frame number

size of page table$=2^{20}\times 14 bits$

assume Frame number$=16bits$

size of page table$=2^{20}\times 16 bits\approx2MB$
edited by
6 votes
6 votes
ans is C.

here page size is 4KB, which is 2^12 (12bits)

given is physical memory 64MB. therefore in bits f+d = f+12 bits

VAS is 32 bits therefore p+d=p+12 bits => p+12=32 => p=20

page table size = num of page table entries * size of each entry

here entry size is not given so we can directly take size of " f " in bits as entry size, which is 14 bit approx 2 bytes
no of pages = 2^32 / 4KB = 2^20
page table size = 2^20 * 2 bytes = 2MB
edited by
2 votes
2 votes

Physical address space =64MB

No. of bits to represent the physical memory =26 bits

Logical address space =32 bits

page size =4 KB

So , the number of pages =2^32 /  2^12 = 2^20

Concept :  Page table only consist of frame number . So , page table size will depend on frame number and we don’t know how many bits do we require to represent the frame number in page table.

We know that , page offset = frame offset  and page offset =12 bits

bits req to represent the frame number = 26 -12 =14 bits

Additionally , In page table we have valid and invalid bit  , for that  we need 2 bits to represent valid (0) or invalid(1)

The bits now required in page table are = 14 + 2 bits =16 bits = 2 bytes

Total size of page table = 2^20 * 2 bytes = 2 MB

 

Answer:

Related questions

22.2k
views
2 answers
47 votes
Kathleen asked Sep 14, 2014
22,191 views
Which of the following statements is false?Virtual memory implements the translation of a program's address space into physical memory address ... increases the degree of multiprogrammingVirtual memory reduces the context switching overhead
13.1k
views
3 answers
37 votes
Kathleen asked Sep 14, 2014
13,075 views
Where does the swap space reside?RAMDiskROMOn-chip cache
8.5k
views
2 answers
22 votes
Kathleen asked Sep 14, 2014
8,454 views
Consider a virtual memory system with FIFO page replacement policy. For an arbitrary page access pattern, increasing the number of page frames in main ... increase the number of page faultsnever affect the number of page faults
12.8k
views
4 answers
27 votes
Kathleen asked Sep 14, 2014
12,836 views
What is printed by the print statements in the program $P1$ assuming call by reference parameter passing?Program P1() { x = 10; y = 3; func1(y,x,x); print x; print y; } ... + z }$\text{10, 3}$\text{31, 3}$\text{27, 7}$None of the above