------------ nfu_worstcase ---------------------- worst case scenario for nfu algorithm with 4 pages of 32 bytes each using time interval of 1 (counter is updated after every memory access). Basically does the following: repeat 10 times: read page 0 read page 1 read page 2 The above sets the counters for pages 0,1 and 2 all to 10. Next we have the following: repeat 10 times: read page 3 read page 4 read page 5 read page 6 Since pages 0,1 and 2 have high counters, they will never be booted, so every one of the reads to pages 3,4,5 and 6 will result in a page fault. When run through the VM simulator with parameters -n 4 -p 32 -t 1 -a nfu, should result in 3 faults for the first part, and 40 faults for the second part: > ./hw4 -n 4 -p 32 -a nfu -t 1 < nfu_worstcase Page Size: 32 # page frames: 4 Replacement Algorithm: nfu Lines processed: 71 Memory operations: 70 Faults: 43 If we change the number of physical pages to 8, it should have only one fault per virtual page accessed: (total of 7 faults): >./hw4 -n 8 -p 32 -a nfu -t 1 < nfu_worstcase Page Size: 32 # page frames: 8 Replacement Algorithm: nfu Lines processed: 71 Memory operations: 70 Faults: 7