The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+22 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}$
asked in Operating System by Veteran (52k points)
edited by | 8.5k views
how to solve this ques........

3 Answers

+39 votes
Best answer
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$
answered by Veteran (406k points)
edited by
Why page entry include frame bits only? Page table entry contains page no. And the corresponding frame no.

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

4 KB = 2^2 KB = 2^2 * 2^10 B = 2^2 * 2^10 * 2^3 bits
+15 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$
answered by Boss (13.6k points)
edited by

how does 14 bits become 2 bytes? 

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

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

@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.


Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
49,541 questions
54,084 answers
70,994 users