We will discuss some more differences between paging and segmentation with the help of the comparison chart shown below.
|Basic||A page has a fixed block size.||A segment of variable size.|
|Fragmentation||Paging can lead to internal fragmentation.||Segmentation can lead to external fragmentation.|
|Address||The address specified by the user divided by CPU into a page number and offset.||The user specifies each address of two quantities, a segment number and the offset (segment limit).|
|Cut it||The hardware decides the size of the page.||The size of the segment specified by the user.|
|table||The pager involves a page table that contains the base address of each page.||Segmentation involves the segment table that contains the segment number and the offset (segment length).|
Definition of Paging
The paging one memory management scheme . Paging allows a process to be stored in a memory in a way not contiguous . Storing the process in a non-contiguous manner solves the problem of fragmentation external .
To implement paging, i physical and logical memory spaces they are divided into the same blocks of fixed dimensions. These blocks of fixed-size physical memory are called frame and fixed-size logical memory blocks are called pages .
When a process needs to be run, the process pages from the logical memory space are loaded into the frames of the physical memory address space. Now the address generated by CPU for access to the frame divided into two parts, or the number of page and the page offset .
Definition of segmentation
Like Paging, also the segmentation one memory management scheme . Supports viewing the memory user. The process divided into segments of variable size and loaded into the address space of the logical memory.
The logical address space is the collection of segments of variable size. Each segment has its own first name is length . For execution, segments from the logical memory space are loaded into the physical memory space.
Key differences between paging and segmentation
- The fundamental difference between paging and segmentation is that a page will always be fixed size, while a segment has variable dimensions .
- Paging can lead to internal fragmentation into as the page of fixed dimensions, but it can happen that the process does not acquire the whole dimension of the block that will generate the internal fragment in memory. Segmentation can lead to external fragmentation when the memory is filled with blocks of variable size.
- In paging, the user provides a only whole number as the address that divided by the hardware in a page number and in Offset . On the other hand, in the segmentation, the user specifies the address in two quantities, or the segment number and the offset .
- The size of the page decided or specified hardware . On the other hand, the size of the specified segment user .
- In the paging, the page table associate the logical address to the physical address and contains the base address of each page stored in the frames of the physical memory space. However, in the segmentation, the segment table map the logical address to the physical address and contains the segment number and the offset (segment limit).
Paging and segmentation are both management schemes of the memory . Paging allows you to split the memory into fixed size blocks while segmentation divides the memory space into segments of the variable block size . Where paging leads to internal fragmentation, the segmentation leads to external fragmentation .