Explain page table with the help of diagram.
Chapter 4
Page Replacement and Segmentation
Compare FIFO, Optimal, LRU, Second-Chance/Clock, NRU and contrast paging with segmentation.
When RAM is full, replacement decides which page to remove; segmentation uses variable-sized logical parts.
Algorithm comparison and Belady's anomaly are high-value exam targets.
Replacement Strategies
From notesClear explanation
FIFO evicts oldest page, LRU evicts least recently used, Clock approximates LRU using reference bits, Optimal evicts farthest future use.
What it really means
Good replacement predicts what you will not need soon.
Key takeaway
Locality-aware policies usually reduce faults.
Segmentation Contrast
From notesClear explanation
Segmentation divides program by logical modules (code/data/stack) with variable sizes and independent protection.
What it really means
Segments follow how humans think about programs; pages follow hardware-friendly uniform blocks.
Key takeaway
Segmentation improves logical organization; paging improves allocation mechanics.
FIFO, LRU, Optimal: How to Decide Victim
Added clarityClear explanation
FIFO removes oldest loaded page, LRU removes least recently used page, and Optimal removes page used farthest in future.
What it really means
Victim page choice is a prediction problem: oldest history, recent history, or perfect future knowledge.
Example
For reference string 7,0,1,2,... with 3 frames, FIFO and LRU can produce different fault counts even with same inputs.
Key takeaway
Always show frame table step-by-step; final count alone is not enough.
Clock Algorithm Logic
Added clarityClear explanation
Clock keeps circular pointer over frames; if reference bit is 0, frame is replaced, otherwise bit is cleared and pointer moves forward until a 0-bit frame is found.
What it really means
Frames get a second chance before eviction.
Example
A recently touched page with bit=1 survives first pass; untouched page with bit=0 is selected as victim.
Key takeaway
Clock approximates LRU with simpler bookkeeping.
- - Assuming FIFO always improves with more frames
- - Using LRU without proper recent-use tracking
- - Treating segmentation and paging as identical
- - Optimal is benchmark, not practical
- - FIFO can show Belady's anomaly
- - LRU approximates locality principle
- - Paging fixed-size, segmentation variable-size logical units
Page fault rate = (Number of page faults / Total references) x 100%
Exam lens for this topic
What evaluators usually expect in structured exam answers.
Must-use keywords
- - FIFO
- - LRU
- - Optimal
- - Belady's anomaly
- - Segmentation
Answer flow
- - Write algorithm replacement rule first
- - Draw frame table row-by-row for reference string
- - Count page faults and compute fault rate
- - Compare result with one other algorithm
Diagram expectations
- - Frame progression table
Repeated pattern: Reference string based page-fault numericals are asked repeatedly.
Practice Questions
Compute page faults for FIFO and Optimal with 3 frames for given reference string.
Source: Winter 2023 Q4(C)
Answer focus: Correct frame updates and fault counting.
Compute page faults for Optimal with 4 frames for long reference string.
Source: Winter 2024 Q4(C) OR
Answer focus: Future-look replacement correctness.
Practice from papers (end-of-topic set)
These paper questions map directly to this topic. Solve now, then compare your structure with linked topics.
Calculate page fault rates for FIFO and Optimal with 4 frames for reference string 0,2,1,6,4,0,1,0,3,1,2,1.
Calculate page fault rates for FIFO and Optimal with 3 frames for reference string 7,0,1,2,0,3,0,4,2,3,0,3,2,0,2,0,1,7,0,1.
Calculate page fault rates for LRU and Optimal with 3 frames for reference string 7,0,1,2,0,3,0,4,2,3,0,3,2,0,2,0,1,7,0,1.
Calculate page faults for FIFO with 4 frames for reference string 1,2,3,4,5,3,4,1,6,7,8,7,8,9,7,8,9,5,4,5,4,2.
Calculate page faults for OPTIMAL with 4 frames for reference string 1,2,3,4,5,3,4,1,6,7,8,7,8,9,7,8,9,5,4,5,4,2.
Calculate page faults for FIFO with 4 frames for reference string 1,2,3,4,5,3,4,1,6,7,8,7,8,9,7,8,9,5,4,5,4,2.
Calculate page faults for OPTIMAL with 4 frames for reference string 1,2,3,4,5,3,4,1,6,7,8,7,8,9,7,8,9,5,4,5,4,2.
Calculate page faults for FIFO with 3 frames for reference string 1,2,3,4,5,3,4,1.
Calculate page faults for LRU with 3 frames for reference string 1,2,3,4,5,3,4,1.
Question Bank Linked Here
Open all questionsExplain page table with the help of diagram.
Calculate page fault rates for FIFO and Optimal with 4 frames for reference string 0,2,1,6,4,0,1,0,3,1,2,1.
Calculate page fault rates for FIFO and Optimal with 3 frames for reference string 7,0,1,2,0,3,0,4,2,3,0,3,2,0,2,0,1,7,0,1.
Calculate page fault rates for LRU and Optimal with 3 frames for reference string 7,0,1,2,0,3,0,4,2,3,0,3,2,0,2,0,1,7,0,1.
Calculate page faults for FIFO with 4 frames for reference string 1,2,3,4,5,3,4,1,6,7,8,7,8,9,7,8,9,5,4,5,4,2.
Calculate page faults for OPTIMAL with 4 frames for reference string 1,2,3,4,5,3,4,1,6,7,8,7,8,9,7,8,9,5,4,5,4,2.
Calculate page faults for FIFO with 4 frames for reference string 1,2,3,4,5,3,4,1,6,7,8,7,8,9,7,8,9,5,4,5,4,2.
Calculate page faults for OPTIMAL with 4 frames for reference string 1,2,3,4,5,3,4,1,6,7,8,7,8,9,7,8,9,5,4,5,4,2.
Calculate page faults for FIFO with 3 frames for reference string 1,2,3,4,5,3,4,1.
Calculate page faults for LRU with 3 frames for reference string 1,2,3,4,5,3,4,1.
How to answer linked exam questions
Full question bankSummer 2023 Q4(B) OR
Explain page table with the help of diagram.
Answer pattern: start with definition, draw neat labeled diagram, then explain flow/parts.
Summer 2023 Q4(C)
Calculate page fault rates for FIFO and Optimal with 4 frames for reference string 0,2,1,6,4,0,1,0,3,1,2,1.
Answer pattern: define briefly, then solve stepwise and show final values/table.
Winter 2023 Q4(C)
Calculate page fault rates for FIFO and Optimal with 3 frames for reference string 7,0,1,2,0,3,0,4,2,3,0,3,2,0,2,0,1,7,0,1.
Answer pattern: define briefly, then solve stepwise and show final values/table.
Winter 2023 Q4(C) OR
Calculate page fault rates for LRU and Optimal with 3 frames for reference string 7,0,1,2,0,3,0,4,2,3,0,3,2,0,2,0,1,7,0,1.
Answer pattern: define briefly, then solve stepwise and show final values/table.
Summer 2024 Q4(C)
Calculate page faults for FIFO with 4 frames for reference string 1,2,3,4,5,3,4,1,6,7,8,7,8,9,7,8,9,5,4,5,4,2.
Answer pattern: define briefly, then solve stepwise and show final values/table.
Summer 2024 Q4(C) OR
Calculate page faults for OPTIMAL with 4 frames for reference string 1,2,3,4,5,3,4,1,6,7,8,7,8,9,7,8,9,5,4,5,4,2.
Answer pattern: define briefly, then solve stepwise and show final values/table.
Extra clarity files
These are clearly marked additions, separate from source notes.