×

Difference between Paging and Segmentation

What is Paging?

Paging is one of the most important terms used in the operating system. Paging divides the physical memory into frames and program’s address space into identical size pages. The size of the page should be always stable. As we know that the dimension of the page should be provided by the hardware itself, it generally guides to internal fragmentation as the page is the fixed block size. In paging, page table is used to map pages with the frames from memory. Page table contains page location as well as frame location. Paging is invisible to the developers. Paging contains static linking and dynamic loading. A page is an actual unit.

Difference between Paging and Segmentation

Important Terminologies used in Paging

  1. Address represented in bits also known as logical address is generated by the CPU.
  2. Virtual address space the combination of all logical addresses are generated by a program.
  3. Physical address will appear on memory unit.
  4. The mapping from the computer generated address to physical address is performed by the memory management unit (MMU) which is hardware device and this process is known as paging technique.
  5. Physical address scope is divided into number of stable size blocks known as frames.
  6. Logical address scope is divided into fixed size blocks which are known as pages.
  7. Page size = frame size.

Memory Management Unit (MMU)

Memory management unit is used for converting logical addresses to physical addresses. Physical address is type of address of frame in which every page is stored, although the logical address is type of address which is generated by the CPU for each page. CPU approaches a page using its logical address. Operating system generally collects physical address in order to approach that page physically. It is also an important term used in operation system.

Physical address contains:

  1. Frame number(F)
    Frame no. defines the number of bits which are required to represent the frame of physical address space also known as frame number.
  2. Frame offset(d)
    It is used to specify the number of bits required to represent a certain word in a frame, or the Physical Address Space frame size, the word number of a frame, or the frame offset.

Hardware implementation of the page table is performed by assigned registers. But the use of register is only beneficial in one condition when page table is too small. If the page table consists of a huge numbers of entries, then we use the TLB (Translation Look aside Buffer), a special, small, quick look up hardware cache.

  1. TLB is a close, high speed memory.
  2. Everyentry in TLB contains two parts, tag and value.
  3. When TLB is used then an item is compared with all tags. If the item is found, then equivalent value is returned.

What is Segmentation?

Segmentation is a memory management technique or process which is used to divide the program from the user's view of memory. It means the program is divided into modules or segments. The blocks that a program is divided into which are not of identical sizes are known as segments. Segmentation provides user view of process. This feature is not included in paging. In segmentation, user view is mapped to physical memory. Segmentation is also another type of non-contiguous memory allocation method like paging. Variable size partitioning is a theme of segmentation. It results in external fragmentation.

It is easy to appeal for protection in segmentation. In segmentation, segments are of different sizes. It also provides more efficient result then paging. It can handle data structures. In segmentation, list of holes is maintained by the operation system. Segments are also known as logical unit of information. There is also no restriction on size of segments. Segmentation is visible to the user and it eases sharing of methods between processes. In segmentation, processors require segment number.

Types of Segmentation

There are mainly two types of segmentations present in the operating system:

  1. Virtual Memory Segmentation: Virtual Memory Segmentation divides the processes into n number of segments. All the segments are not divided at a time. Virtual Memory Segmentation may or may not take place at the run time of a program.
  2. Simple Segmentation: In simple segmentation, every process is divided into number of segments, all of which loaded in memory at run time, not continuously.

Simple relationship cannot be maintained between logical and physical addresses in segmentation. A table collects the information related to all segments which is known segment table. Segment table maps 2D logical address into one dimensional physical address. Every entry of table contains base address and its limit.

  1. Base address: It consists of starting physical address where segments occupy in memory.
  2. Limit: The limit specifies the length of particular segment.

Address generated by CPU

  1. Segment number (S): It specifies the numbers of bits needed to present the segment.
  2. Segment offset (D): It specifies the numbers of bits needed to present the size of the segment.

Advantages of Segmentation

  1. There is no internal fragmentation in segmentation.
  2. In segmentation, segment table consumes less space as compare to page table in paging.
  3. Whole module is loaded only once and segmentation improves CPU utilization.
  4. It is a type of method which is used to segregate data from security operations.
  5. In segmentation, segment is specified by the user whereas in paging the hardware determines the page size.

Disadvantages of Segmentation

  1. The major disadvantage of segmentation is that the approach time to retrieve the instruction increases because in segmentation there are two memory accesses, one for segment table and another for main memory.
  2. Overhead is connected with keeping a segment table for each activity.
  3. As we know that processes are loaded as well as removed from the memory, the free memory space is divided into small pieces which results in external fragmentation.   

Related Topics

Difference between Need and Want

Difference between Need and Want Every living being on this planet has some materialistic necessity. Human beings, birds, animals, plants, trees, insects, bacteria and viruses; all of these want something to...

6 minutes read.

Difference between Fixed and Dynamic Channel Allocations

Radio resource management for wireless and cellular networks uses channel allocation strategies to provide bandwidth and communication channels to base stations, access points, and terminal devices.The two types of channel...

3 minutes read.

Desktop OS vs Embedded OS

The difference between a desktop operating system and an embedded operating system is explained in this article. But, before we get into the differences, it's very important to know the...

6 minutes read.

Difference between Flash Drives and Hard Drives

Users are constantly in need of memory devices that can hold numerous, large files due to the endless list of tasks carried out today through the usage of personal computers....

4 minutes read.

Difference between HTTP and HTTPS

HTTP vs HTTPS | Difference between HTTP and HTTPS What is HTTP? HTTP stands for “Hyper Text Transfer Protocol”. It is a set of specific rules and standards, which control the transmission...

5 minutes read.

Difference between Guidance and Counseling

Guidance meaning Guidance is the direction or advice given to a person by an expert or certified individual in a particular department. In other words, guidance means the action where an...

3 minutes read.

Difference between Persistent and Non-Persistent Connection

We all use the internet, and we usually search on the internet for different things. It looks so easy when we search anything on the internet. It is all right...

3 minutes read.

difference between Dependency and DevDependencies

Introduction There is a file named package.json present in every web project. It contains all the data needed for the project, which is also called metadata. All the dependencies needed for...

2 minutes read.

Difference between NPM and NPX

Despite being two quite different tools, NPM and NPX are frequently being misunderstood or confused. Most of the time, consumers are utilising one of these without even realising it. To...

3 minutes read.

Difference between Subnetting and Supernetting

In this article, we are going to study about the Subnetting and Supernetting. We are going to see the differences between Subnetting and Supernetting. Both Subnetting and Supernetting are related...

3 minutes read.

Difference between Intel and AMD

1. Intel  Intel stands for Integrated Electronics. The headquarters of the American technology business Intel Corporation is in Santa Clara, California's Silicon Valley. It created the Intel 8086, which was the...

2 minutes read.

Difference between Analytical Engine and Difference Engine

Analytical Engine It is used for general propose engine that is fully controlled that includes the automatic mechanical digital computer into it. In the Analytical Engine, all the calculations are done...

1 minute read.

Difference between Procedural and Declarative Knowledge

The information can be presented in a variety of forms to the computer's inference in order to address issues related to the rule. So, in this article, we'll talk about...

2 minutes read.

Difference between Visa and Passport

Traveling is an inevitable part of life. People travel to distant areas for work, jobs, studies, etc. Traveling helps us in having a practical experience of places, cities, countries, etc....

4 minutes read.

Difference between PATA and SATA

What is PATA? The acronym PATA stands for Parallel ATA (Advanced Technology Attachment). It is a type bus interface used to connect various secondary storage devices. Such devices include hard drives,...

2 minutes read.

Difference between Multimedia and Hypermedia

From the widespread usage of desktop computers in the late 1950s to the complex, sophisticated systems of today, technology has advanced significantly. The modern conveniences and the exponential global growth...

3 minutes read.

Difference between ERP and SAP Software

There are different businesses running in the world. Not only large businesses, the small businesses are also need a lot of planning to run in a smooth manner. All the...

3 minutes read.

Difference between MD5 and SHA1

MD5 and SHA1 are two hashing methods. Although MD5 is quick and easy to use, it does not offer enough security. Compared to MD5, SHA1 is more complicated but offers...

3 minutes read.

Difference between TV and Computer Display

These two are hardware products that have screens that show graphics, pictures, and movies. Despite having the same capability, their applications are widely diverse. We shall examine the distinction between...

3 minutes read.

Difference between UART and USART

Universal Asynchronous Receiver Transmitter is referred to as UART. Universal Synchronous Asynchronous Receiver Transmitter is referred to as USART. They are merely a piece of hardware that transforms parallel data...

3 minutes read.