The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+20 votes
2.8k views

If an instruction takes $i$ microseconds and a page fault takes an additional $j$ microseconds, the effective instruction time if on the average a page fault occurs every $k$ instruction is:

  1. $i + \dfrac{j}{k}$

  2. $i +(j\times k)$

  3. $\dfrac{i+j}{k}$

  4. $({i+j})\times {k}$

asked in Operating System by Veteran (59.7k points)
recategorized by | 2.8k views

7 Answers

+24 votes
Best answer

Page fault rate $=\dfrac{1}{k}$
Page hit rate $=1-\dfrac{1}{k}$
Service time $=i$
Page fault service time $= i+j$

Effective memory access time,

$\quad =\dfrac{1}{k}\times (i+j)+\left(1-\dfrac{1}{k}\right)\times i$

$\quad=\dfrac{(i+j)}{k}+i-\dfrac{i}{k}$

$\quad=\dfrac{i}{k}+\dfrac{j}{k}+i-\dfrac{i}{k}$

$\quad=i+\dfrac{j}{k}$

So, option (A) is correct.

answered by Junior (569 points)
edited by
+1
thats the beauty of gate .... nice ans ...
0

since each instruction takes i microseconds and a page fault occurs after k instructions. so after ki microseconds, 1 page fault occurs.

in ki time, 1 page fault

in 1 time, i/ki page fault

so doesn't this make the rate as 1/ki  ???

My question is here.

+1
Okay then : total time to execute k instructions= ik + j

                         so effective instruction time = (ik+j)/k

                                                                       = i+j/k     Ans
0

I think 

page fault takes an additional $j$

making the access hierarchical. Right? Also,  there seems to be no option for simultaneous... 

+8 votes
Here, given that On an average page fault occurs at every 'k' seconds. So, probability of getting a page fault is (1/k).

 

Effective Instruction Time = Normal instruction execution Time + Average Page Fault Service Time

i.e. Avg Page Fault Service Time = prob. of getting page fault * page fault service time =(1/k )* j

 

so its "i + (1/k)*j".
answered by (101 points)
+7 votes

Lets take a example

no of instruction =6

i=4(Normal instrction execution time)

j=2(Additional time incase of page fault)

k=3(Page fault occurs on every kth instruction)

Total time required=4+4+(4+2)+4+4+(4+2)=28

Average time=28/6=4.66

Now substitute the i,j,k values in options 

i+j/k=4+2/4=4.66

so A is the answer

answered by Active (2.7k points)
+4 votes
ans a)
answered by Loyal (5.3k points)
+3 votes
One more way could be. Let us we have 100 instruction then page fault will occur 100/k times. So

Total execution time  = 100*i +  (100/k)*j

So avg execution time  = (Total execution time)/(Total number of instruction) = i + (j/k).

 

Answer is (A) Part.
answered by Boss (11.8k points)
+1 vote
One more way we can do is as follows

 

EMAT= m+p(ps)...{y=mx+c}

i+j/k

 

A)
answered by Active (3.9k points)
+1 vote
1 instruction takes i ms.

k instructions will take k*i ms.

1 page fault in every k instructions. Page Fault Service Time is j ms.

So,

Total time required to execute k instructions is (k*i+j) ms.

 

so here ,

Effective instruction time = (k*i+j)/k

i.e, i + j/k
answered by (407 points)
Answer:

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

44,250 questions
49,744 answers
164,044 comments
65,842 users