Paging and Segmentation - Complete Notes
(Engineering Exam)
1. Paging: Principle of Operation
Paging is a memory management technique in which the logical address space of a process is
divided into fixed-size blocks called pages and physical memory is divided into frames of the same
size.
Each page is mapped to a frame using a page table maintained by the operating system.
Logical Address (CPU) → Page Number + Offset
Page Table:
Page No → Frame No
Physical Address:
Frame No + Offset
2. Page Allocation
Page allocation refers to assigning frames in physical memory to pages of a process.
Types:
1. Fixed Allocation: Each process gets fixed number of frames.
2. Variable Allocation: Frames vary depending on process needs.
3. Local Allocation: Process uses its own frames.
4. Global Allocation: Process can use frames of other processes.
3. Hardware Support for Paging
Paging requires hardware support for efficient address translation.
Main components:
• Page Table Register (PTR)
• Translation Lookaside Buffer (TLB)
• Memory Management Unit (MMU)
CPU → MMU → TLB → Page Table → Physical Memory
4. Protection and Sharing
Protection is achieved using bits in page table entries:
• Read/Write bit
• Valid/Invalid bit
• Execute bit
Sharing is possible by mapping multiple processes to the same frame.
Example: Shared libraries.
5. Advantages of Paging
• No external fragmentation
• Efficient memory utilization
• Supports virtual memory
Disadvantages of Paging
• Internal fragmentation
• Page table overhead
• Slower access due to address translation
6. Segmentation: Principle of Operation
Segmentation divides memory into variable-sized segments such as code, data, and stack.
Each segment has a base and limit.
Logical Address → Segment No + Offset
Segment Table:
Segment No → Base + Limit
7. Protection and Sharing in Segmentation
Each segment has protection bits.
Segments can be shared between processes easily.
8. Advantages of Segmentation
• Logical division of program
• Supports protection and sharing
• No internal fragmentation
Disadvantages of Segmentation
• External fragmentation
• Complex memory management