Question

In: Computer Science

b) Given fixed memory partitions of 200 KB, 100 KB, 400 KB, 300 KB, and 400...

b) Given fixed memory partitions of 200 KB, 100 KB, 400 KB, 300 KB, and 400 KB (in order), how would each of the algorithms from (a) place processes in memory if they required 187 KB, 228 KB, 126 KB, 306 KB (in order)? c) A system has five page frames. The time of loading, time of last access, and the Referenced and Modified bit for each page are shown in the following table (with time in clock ticks). Frame Loaded Last referenced Referenced Modified 0 76 115 1 0 1 99 118 1 0 2 68 76 0 1 3 63 78 1 0 4 12 86 0 1 For each of the following algorithms, which page would be the next to be replaced? i. Second chance ii. Clock

Solutions

Expert Solution

b) memory partitions of 200 KB, 100 KB, 400 KB, 300 KB, and 400 KB and assuming the algorithms are first fit, best fit and worst fit:

Order : 187 KB, 228 KB, 126 KB, 306 KB

First Fit:

187KB is put in 200KB partition

current situation: 13KB(new partition),100KB,400KB,300KB,400KB

228KB is put in 400KB partition

current: 13KB,100KB,172KB(new partition),300KB,400KB

126KB is put in 172KB partition

current: 13KB,100KB,46KB(new partition),300KB,400KB

306KB is put in 400KB partition

current: 13KB,100KB,46KB,300KB,94KB(new partition)

Best Fit:

187KB is put in 200KB partition

current situation: 13KB(new partition),100KB,400KB,300KB,400KB

228KB is put in 300KB partition

current situation: 13KB,100KB,400KB,72KB(new partition),400KB

126KB is put in 400KB partition

current: 13KB,100KB,274KB(new partition),72KB,400KB

306KB is put in 400KB partition:

current: 13KB,100KB,274KB,72KB,94KB(new partition)

Worst Fit:

187KB is put in 400KB partition

current situation: 200KB,100KB,213KB(new partition),300KB,400KB

228KB is put in 400KB partition

current situation: 200KB,100KB,213KB,300KB,172KB(new partition)

126KB is put in 300KB partition

current situation: 200KB,100KB,213KB,174KB(new partition),172KB

306KB must wait

2nd part:

Frame Loaded Last Referenced Referenced Modified
0 76 115 1 0
1 99 118 1 0
2 68 76 0 1
3 63 78 1 0
4 12 86 0 1

Second chance:

In case of second chance algorithm the frame to be replaced next is frame 4 as it arrived the earliest and has referenced bit = 0

Clock algorithm:

When we check the last referenced time of each frame we see last examined page is 1 and the earliest examined frame is 2 so if we keep them in order we get

1 0 4 3 2 the hand of the clock will be pointing to frame 1.

But the referenced bit of frame 1 is 1 so it cant be evicted, so we set the referenced bit of frame 1 to 0 and move to next frame

Next frame is frame 0, whose referenced bit again is 1, so moving to the next frame

Next frame is 4 and the referenced bit of 4 is 0 so frame 4 will be evicted.


Related Solutions

4. For n = 50, 100, 200, 300, 400, do the following. Let A be the...
4. For n = 50, 100, 200, 300, 400, do the following. Let A be the n × n matrix with entacries Aij = p 2(i − j) 2 + n/5. Define xexact = [1, 1, . . . , 1]T , and then compute b = Axexact. Using Matlab’s backslash, numerically solve the equation Ax = b, thereby producing a computed solution xc. In exact arithmetic xc = xexact of course, but in IEEE double precision xc will not...
4. For n = 50, 100, 200, 300, 400, do the following. Let A be the...
4. For n = 50, 100, 200, 300, 400, do the following. Let A be the n × n matrix with entries Aij = p 2(i − j) 2 + n/5. Define xexact = [1, 1, . . . , 1]T , and then compute b = Axexact. Using Matlab’s backslash, numerically solve the equation Ax = b, thereby producing a computed solution xc. In exact arithmetic xc = xexact of course, but in IEEE double precision xc will not...
1. (A-D) A) a = 400 b = .9 I = 300 G = 200 T...
1. (A-D) A) a = 400 b = .9 I = 300 G = 200 T = 150 (b = MPC) a) Solve for Y* (equilibrium output) b) What is the value of the spending (Keynesian) multiplier? c) What is the value of the tax multiplier? d) What is the value of the 'balanced budget' multiplier? B) a = 400 b = .9 I = 300 G = 300 (an increase of 100 from A above) T = 150 a)...
If the bond energy for A2, B2, and A-B is 300, 200 and 100 kJ/mole, respectively,...
If the bond energy for A2, B2, and A-B is 300, 200 and 100 kJ/mole, respectively, the change in energy for the following reaction A2+B2=2A-B should be (in kJ): 500 300 -300 400 -400 Based on Coulomb’s law, when the K+ and Cl- ions are placed 10 nm apart, their interaction energy should be (in J): -2.31x10-19 -2.31x10-20 2.31x10-20 2.31x10-19 -2.31x10-18 Using the energy equation for the H atom, determine its energy when its principal quantum number n=∞ (in J):...
Disposable Income Consumption 0 $200 billion $200 billion 300 billion 400 billion 400 billion 600 billion...
Disposable Income Consumption 0 $200 billion $200 billion 300 billion 400 billion 400 billion 600 billion 500 billion 800 billion 600 billion How much is the marginal propensity to consume when disposable income rises from $600 billion to $800 billion? Select one: a. 0.65 b. 0.5 c. 0.75 d. 0.85
Retained Earnings T-Account: Debit- 200 and 400/ Credit-700 Dividends T-Account: Debit-100, 100, and 200/ Credit-400 Income...
Retained Earnings T-Account: Debit- 200 and 400/ Credit-700 Dividends T-Account: Debit-100, 100, and 200/ Credit-400 Income Summary T-Acount: Debit- 1,500/ Credit- 800, and 700 Find (a) the revenue for the period (b) Dividends for the period (c) Net income (d) Ending balance of retained earnings
Argentina Chile Capital 200 machines 100 machines Labor 500 workers 400 workers (a) Given the table...
Argentina Chile Capital 200 machines 100 machines Labor 500 workers 400 workers (a) Given the table above, which country is relatively more labor abundant? Which is relatively capital abundant? Show how you know by stating your decision rule. (b) Suppose that the Argentina and Chile have the factor endowments given in the table in part (a). Suppose further that the production requirements for a unit of steel is two machines and eight workers, and the requirement for a unit of...
A loan L is repaid with annual payments of $500, $400,$300, and $200 at the end...
A loan L is repaid with annual payments of $500, $400,$300, and $200 at the end of each year using a sinking fund method. If the loan has 10%effective interest rate per year and the sinking fund has 8% effective interest our year, find L
Private saving in an economy is given by Sv = 200 + 5r, where r is the real rate of interest. Net taxes are 300 and government purchases are 400, while govt transfer payments are 100.
Private saving in an economy is given by Sv = 200 + 5r, where r is the real rate of interest. Net taxes are 300 and government purchases are 400, while govt transfer payments are 100. This country lends 200 internationally each year, and investment is given by I = 1200 – 5r. Finally, the inflation rate in this economy is 8%. According to the loanable funds theory of interest, what is the equilibrium value for the real interest rate?
Period Forecast 1 200 2 500 3 300 4 400 5 200 6 200 Regular time:...
Period Forecast 1 200 2 500 3 300 4 400 5 200 6 200 Regular time: $20 per unit (maximum of 280 units per period) Overtime:    $30 per unit (maximum of 40 units per period) Subcontracting:    Not available Beginning inventory:   None Carrying cost: $10 per unit per period Backorder cost: $50 per unit per period What is the total regular time cost for the plan which minimizes total cost? Round answer to nearest dollar. Do not use a...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT