×

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

Anxiety vs Depression

Difference between Anxiety and Depression The terms anxiety and depression are used by people very casually, but these terms have a very serious outcome. Both explain an emotion of a person....

8 minutes read.

Difference between Audit and Review

Audit Vs Review Business entrepreneurs look for different options to save their time and money when it comes to financial statements. Both the methods: Audit and Review, is used for the...

4 minutes read.

Dark Chocolate vs White Chocolate

Difference between Dark Chocolate and White Chocolate Chocolate is the world's most popular sweet dessert. The cocoa berry (cocoa) is broken down into chocolate liquid (the crushed or melted state of...

4 minutes read.

Difference between TDMA, CDMA, and FDMA

These are all methods of exchanging and transmitting data. Because of their unique traits and features, they are particularly useful in a variety of contexts. In this article, we will...

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 Extender and Repeater

Nowadays, we all use Wi-Fi in our houses and offices. We can easily connect and use the internet without any wire connection between the gadgets and the router. So, the...

4 minutes read.

Difference between Wi-Fi and Cellular Network

You must have familiar with the term Wi-Fi and cellular data. These terms are used in the field of internet connections. Many times we get confused about these two things....

3 minutes read.

Difference between President and Prime Minister

The country's first citizen and head of state is the President. The Prime Minister, on the other hand, leads the country's government at the national level, together with the other...

4 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 Open-Source Software and Free Software

Most people think that the difference between "free software" and "open-source software" is just a philosophy or approach. According to the Open-Source Initiative, these phrases are interchangeable and have the...

4 minutes read.

Difference between OTG and Microwave

OTG OTG’s complete form is Oven, toaster, grill. It is a mini model of a traditional oven. OTG oven is used for baking, toasting, reheating, and grilling food. It uses heated...

2 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 Dicot and Monocot seeds

Dicot seed Dicot seeds are the seeds that comprise two embryonic leaves or cotyledons. They are also called dicotyledons. It includes one embryo with an embryo axis and two cotyledons all...

2 minutes read.

Difference between two tier and three tier database architecture

Two Tier Architecture There are two layers in two Tier architecture. One is the client layer; another one is a database server. Here Client means a machine, and there is an...

2 minutes read.

Difference between Bone and Cartilage

Difference between Bone and Cartilage Human body is the most sophisticated creation of the nature. The body that we look in the mirror is the most complex machine as well. This...

6 minutes read.

Difference Between AES and DES Ciphers

AES, whichstands for Advanced Encryption Standard, was introduced by Joan Daemen and Vincent Rijmen. It is simply defined as the most widely used method for encrypting and decrypting sensitive information....

4 minutes read.

Difference between MVP and MVVM

Model View Presenter (MVP) architecture, which aids in creating interfaces that meet user needs, is descended from the Model View Controller form. The presenter serves as a middleman and gives...

3 minutes read.

Difference between Hematite and Magnetite

What are Iron ores? Iron makes up a large portion of both the Earth's outer and inner cores, making it the most prevalent element on Earth by mass, just ahead of...

3 minutes read.

Difference between OSS and BSS

We use mobile phones wherever we want. The usage of the mobile phones is only possible using the telecommunication network. The telecommunication helps in building up the platform and network...

3 minutes read.

Difference between Open-Source Software and Proprietary Software

The commercial software business is most terrified by the idea of open-source software, yet open-source has plenty of developers and programmers on its plate who are least intimidated by the...

3 minutes read.