0% found this document useful (0 votes)
119 views5 pages

Segmentation

Segmentation in programming

Uploaded by

py287244
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
119 views5 pages

Segmentation

Segmentation in programming

Uploaded by

py287244
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Segmentation

What is Segmentation?
 Segmentation is another non-contiguous memory allocation scheme
like paging.
 It is a variable-size partitioning theme. Like paging, in segmentation,
secondary and main memory are not divided into partitions of equal
size. The partitions of secondary memory area units are known as
segments. The details of every segment are hold in a table known as
segmentation table.
 Segment table contains two main data segment, one is Base, which is
the bottom address of the segment and another is Limit, which is the
length of the segment.
What is Segment Table?
 There is no simple relationship between logical addresses and physical
addresses in segmentation. A table stores the information about all such
segments and is called Segment Table.
It maps a two-dimensional Logical address into a one-dimensional Physical
address. It’s each table entry has: 1)Base Address: It contains the starting
physical address where the segments reside in memory. 2)Segment
Limit: Also known as segment offset. It specifies the length of the segment.
 In segmentation, the CPU generates a logical address that contains the Segment number and
segment offset. If the segment offset is a smaller amount than the limit then the address
called valid address otherwise the address is invalid.
The address generated by the CPU is divided into:
Segment number (s): Number of bits required to represent the segment.
Segment offset (d): Number of bits required to represent the position of data within a segment
.
 Advantages of Segmentation in Operating System
• Reduced Internal Fragmentation : Segmentation can reduce internal
fragmentation compared to fixed-size paging, as segments can be sized
according to the actual needs of a process.
• Flexibility: Segmentation provides a higher degree of flexibility than paging.
• Segment Table consumes less space in comparison to Page table in paging.
• Sharing: Segmentation allows for sharing of memory segments between
processes. This can be useful for inter-process communication.
• The user specifies the segment size, whereas, in paging, the hardware
determines the page size.
• As a complete module is loaded all at once, segmentation improves CPU
utilization.

 ``````````````Q A111

You might also like