Free Essay

Itsc1405

In:

Submitted By e472258
Words 522
Pages 3
Answers to Chapter 3:
Exercise 4a: I divide the length of the program by the page size, and round up to the nearest integer. 510 ÷ 256 = 1 page 510 ÷ 256 = 1.9922 rounded 2 pages 256 or 254 remainder
We need two pages to store the entire job.
Exercise 4b: 510 ÷ 256 = 1 page 510 ÷ 256 = 1.9922 256 or 254 remainder

510 = 256 * 1 + 254 or 256 * 0.9922 = 254 bytes

The exact location of Byte 510 is at Byte 254 of the second page (Page 1). The first 256 is located in Page 0 (first page). The remainder 254 is located in Page 1 (second page) byte 254.

Exercise 5a: FIRST-IN FIRST-OUT Algorithm (FIFO)
Page request a c a b a d a c b d e f
Page fault * * * * * * * * * *
Page Frame 1 a a a a a d d d b b b f
Page Frame 2 c c c c c a a a d d d
Page Frame 3 b b b b c c c e e
Swapped Out: a , c, b, d, a, c, b

According to the given information, this algorithm generates a page replacement scheme with 10 page faults.
Failure ratio: 10/12= 83%
Success ratio: 2/12= 17%

Exercise 5b: FIRST-IN FIRST-OUT Algorithm (Increase a Page Frame)
Page request a c a b a d a c b d e f
Page Fault * * * * * *
Page Frame 1 a a a a a a a a a a e e
Page Frame 2 c c c c c c c c c c f
Page Frame 3 b b b b b b b b b
Page Frame 4 d d d d d d d

Failure ratio: 6/12=50%
Success ratio: 6/12=50%
5c: Statement
The result was expected. The extra page frame increased by 33% its effectiveness and decreased by the same percentage (33%) the failure ratio. Adding memory was helpful here.

Exercise 6a:
Page request a c b d a c e a c b d e
Page fault * * * * * * * * *
Page Frame 1 a a a d d d e e e e e e
Page Frame 2 c c c a a a a a b b b
Page Frame 3 b b b c c c c c d d

Failure ratio: 9/12 = 75%
Success Ratio: 3/12= 25%

Exercise 6b:

Page request a c b d a c e a c b d e
Page Fault * * * * * * * * * *
Page Frame 1 a a a a a a e e e e d d
Page Frame 2 c c c c c c a a a a e
Page Frame 3 b b b b b b c c c c
Page Frame 4 d d d d d d b b b

Failure ratio: 10/12=83%
Success Ratio: 2/12=17%

Exercise 6c: Statement
By adding memory, I expected to decrease the success ratio (by 8%), but also to increase the unacceptable failure ratio (by 8%). This case is an example that buying more memory may not be always the best solution.

Similar Documents