6.6k 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 | 6.6k 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)
answered by Veteran (359k points)
edited by
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=226 B

Size of frame =4KB =212B

No. of frames =  physical memory/size of frame = 226/212 =214

No.of bits for frame =14 bits

Virtual memory =32 bit =232

Size of page =size of frame =4KB =212B

No. of pages =virtual memory/size of page =232 /212 =220 B

Page table enteries=No.of pages =220 B

size of page table entry =Page table enteries *No.of bits for frame

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

answered by Boss (14.2k points)
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
answered by Loyal (8.2k points)
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.