edited by
14,906 views
44 votes
44 votes
The address sequence generated by tracing a particular program executing in a pure demand paging system with $100$ bytes per page is
$\text{0100, 0200, 0430, 0499, 0510, 0530, 0560, 0120, 0220, 0240, 0260, 0320, 0410.}$
 
Suppose that the memory can store only one page and if $x$ is the address which causes a page fault then the bytes from addresses $x$ to $\text{x + 99}$ are loaded on to the memory.

How many page faults will occur?

  1. $0$
  2. $4$
  3. $7$
  4. $8$
edited by

4 Answers

Best answer
74 votes
74 votes

$0100$ - page fault, addresses till $199$ in memory

$0200$ - page fault, addresses till $299$ in memory

$0430$ - page fault, addresses till $529$ in memory

$0499$ - no page fault

$0510$ - no page fault

$0530$ - page fault, addresses till $629$ in memory

$0560$ - no page fault

$0120$ - page fault, addresses till $219$ in memory

$0220$ - page fault, addresses till $319$ in memory 

$0240$ - no page fault

$0260$ - no page fault

$0320$ - page fault, addresses till $419$ in memory 

$0410$ - no page fault

So, $7$ is the answer- (C)

edited by
10 votes
10 votes
Option C is correct we will get 7 page faults. since for each fault, only 100 bytes will be loaded from the faulted byte onwards. 0100 causes fault then 0100 to 0199 will be loaded. Reffering to any byte in this range will not cause any fault. But next is 0200 which is not available so it is fault will load 0200 to 0299. like that we will have total 7 faults.
1 votes
1 votes
Consider [A-B] is range of numbers loaded on to the page or frame in Main memory. if 'A' referred B=A+99, this is given.

Loading sequences

for references 100, 200, 430, 530, 120, 220, 320 following are the contents in the page

[100-199] ==> [200-299] ==> [430-529] ==> [530-629] ==> [120-219] ==>[220-319] ==> [320-419]

 

count the transformations which is = 7
Answer:

Related questions

66 votes
66 votes
9 answers
2
Kathleen asked Sep 18, 2014
23,663 views
The minimum number of page frames that must be allocated to a running process in a virtual memory environment is determined bythe instruction set architecturepage sizenum...