Paging with Segmentation

Filter Course


Paging with Segmentation

Published by: Zaya

Published date: 22 Jun 2021

Paging with Segmentation Photo

Paging with Segmentation

Pure segmentation is not very popular and not being used in many of the operating systems. However, Segmentation can be combined with Paging to get the best features out of both techniques.

In Paging with Segmentation, the main memory is divided into variable size segments which are further divided into fixed-size pages.

  1. Pages are smaller than segments.
  2. Each Segment has a page table which means every program has multiple page tables.
  3. The logical address is represented as Segment Number (base address), Page number, and page offset.

Segment Number → It points to the appropriate Segment Number.

Page Number → It Points to the exact page within the segment

Page Offset → Used as an offset within the page frame

Each Page table contains various information about every page of the segment. The Segment Table contains the information about every segment. Each segment table entry points to a page table entry and every page table entry is mapped to one of the pages within a segment.

paging with segmentation

Translation of logical address to a physical address

The CPU generates a logical address which is divided into two parts: Segment Number and Segment Offset. The Segment Offset must be less than the segment limit. Offset is further divided into a Page number and Page Offset. To map the exact page number in the page table, the page number is added to the page table base.

The actual frame number with the page offset is mapped to the main memory to get the desired word in the page of a certain segment of the process.

translation with segmentation

Advantages of Segmented Paging

  1. It reduces memory usage.
  2. Page table size is limited by the segment size.
  3. The segment table has only one entry corresponding to one actual segment.
  4. External Fragmentation is not there.
  5. It simplifies memory allocation.

Disadvantages of Segmented Paging

  1. Internal Fragmentation will be there.
  2. The complexity level will be much higher as compare to paging.
  3. Page Tables need to be continuously stored in the memory.