8.5k views

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 | 8.5k views
0
how to solve this ques........

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
0
Why page entry include frame bits only? Page table entry contains page no. And the corresponding frame no.
+1

Page in physical memory is page frame. And PTE (in last level page table) needs to identify frame only.

http://stackoverflow.com/questions/11783981/is-number-of-frame-number-of-pageslinux

0
4 KB = 2^2 KB = 2^2 * 2^10 B = 2^2 * 2^10 * 2^3 bits
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
0

how does 14 bits become 2 bytes?

220 *14bits =220 * 2bytes =2 *220 B =2MB

0
its is near by answer , & right also.
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
0
why f is 14 bits ?? shouldn't the page size and frame size are both equal ??
shouldn't it be  12 bit(4 KB)
+1

@Anjali :

Page size and frame size is same.

f here represents number of bits required to locate a single frame in the physical memory not the frame size.

1
2