homework_7 Version 0 |
|
👤 Author: by 353575688qqcom 2017-12-20 09:45:36 |
a. 1. The initial value of the counters is: 0
2. Counters are add 1 when each page fr
3. Counters are minus 1 when the replaced page was not appeared.
4. Every time a new page need to replace page fr
b. reference string: 1, 2, 3, 4, 5, 3, 4, 1, 6, 7, 8, 7, 8, 9, 7, 8, 9, 5, 4, 5, 4, 2
c represent counter
M represent Miss, also page fault
H represent Hit
Page fr | 1(M, c=1) | 1(c=1) | 1(c=1) | 1(c=1) | 5(M, c=2) | 5(c=2) | 5(c=2) | 5(c=1) | 5(c=1) | 5(c=1) |
Page fr | 2(M, c=1) | 2(c=1) | 2(c=1) | 2(c=1) | 2(c=1) | 2(c=1) | 2(c=1) | 2(c=1) | 2(c=1) | |
Page fr | 3(M, c=1) | 3(c=1) | 3(c=1) | 3(H, c=0) | 3(c=0) | 1(M, c=0) | 6(M, c=0) | 7(M, c=1) | ||
Page fr | 4(M, c=1) | 4(c=1) | 4(c=1) | 4(H, c=1) | 4(c=1) | 4(c=1) | 4(c=1) | |||
Page fr | 5(c=1) | 5(c=1) | 5(c=1) | 5(c=1) | 5(c=1) | 5(c=1) | 5(c=1) | 5(H, c=1) | 5(c=1) | 5(H, c=0) |
Page fr | 8(c=2) | 8(c=2) | 8(H, c=2) | 8(c=2) | 8(c=2) | 8(H, c=1) | 8(c=1) | 8(c=1) | 8(c=1) | 8(c=1) |
Page fr | 7(M, c=1) | 7(H, c=1) | 7(c=1) | 7(c=1) | 7(H, c=0) | 7(c=0) | 7(c=0) | 7(c=0) | 4(M, c=0) | 4(c=0) |
Page fr | 4(c=1) | 4(c=1) | 4(c=1) | 9(M, c=2) | 9(c=2) | 9(c=2) | 9(H, c=1) | 9(c=1) | 9(c=1) | 9(c=1) |
Page fr | 5(c=0) | 2(M, c=0) | ||||||||
Page fr | 8(c=1) | 8(c=1) | ||||||||
Page fr | 4(H, c=0) | 4(c=0) | ||||||||
Page fr | 9(c=1) | 9(c=1) |
So there are 12 page faults
c.
Page fr | 1(M) | 1 | 1 | 1 | 1 | 1 | 1 | 1(H) | 6(M) | 6 |
Page fr | 2(M) | 2 | 2 | 5(M) | 5 | 5 | 5 | 5 | 5 | |
Page fr | 3(M) | 3 | 3 | 3(H) | 3 | 3 | 3 | 7(M) | ||
Page fr | 4(M) | 4 | 4 | 4(H) | 4 | 4 | 4 | |||
Page fr | 8(M) | 8 | 8(H) | 8 | 8 | 8(H) | 8 | 8 | 4(M) | 4 |
Page fr | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5(H) | 5 | 5(H) |
Page fr | 7 | 7(H) | 7 | 7 | 7(H) | 7 | 7 | 7 | 7 | 7 |
Page fr | 4 | 4 | 4 | 9(M) | 9 | 9 | 9(H) | 9 | 9 | 9 |
Page fr | 4(H) | 4 | ||||||||
Page fr | 5 | 2(M) | ||||||||
Page fr | 7 | 7 | ||||||||
Page fr | 9 | 9 |
So there are 11 page faults.
Please login to reply. Login