What is Memory Segmentation? | Purpose of Segmentation and advantages.
Segmented Memory |
Memory Segmentation in 8086 Microprocessor:
Introduction:
The word segmentation means separating or dividing. Here the segmentation of memory means dividing the memory into different segments. Every microprocessor contains a memory which is the main part where the data and instructions are stored, fetched, and transferred. The memory of the 8086 microprocessor is divided into segments in such a way that each segment contains a base address of its own. The main features of any memory of a system are memory capacity, memory organization, and memory speed or access time. The segmentation is done for the improvement of the features of the memory as well as the microprocessor and the whole system. The processor of a system can easily fetch and execute the data and instructions from the memory where the segmentation is done. In 8086 microprocessor the minimum size of a segment is 16 bytes and the maximum size ranges 64-kilobytes and the starting address of any segment is evenly divided by 16 which will always be changing and the CPU of 8086 addresses 1MB of memory.
A segment has no exact location in the memory it may exist anywhere and segments may be overlapped or non-overlapped in the memory of the 8086 microprocessor. And both the overlapped and non-overlapped segments are two different types of segmentation.
Overlapped Segment; where the starting address of any segment would be a particular address and it will go up to 64-kilobytes of maximum size. Along with this segment location, another segment also starts, and hence, the two segments are called overlapping segments.
Non-overlapping; same as the above situation the first segment starts with a particular address of 64-kilobytes maximum size but another segment starts before the maximum size range of the first segment and that is called to be a non-overlapping segment.
Why the segmentation of memory is needed?
The need for segmentation is basically and mainly concerned
with the four-segment registers of the Bus Interface Unit BIU, which are Code
segment register CS, Data segment register DS, Extra segment register ES, and
the Stack segment register SS. There are 20 address lines in 8086, and the BIU
has to send a 20bit address to access the 1MB memory location. The upper
starting addresses of all the four segments are 16-bits of 64 KB memory segments
on which the 8086 is activated to work. The 8086 does not access the 1MB memory
as a whole at a time so it is managed by the segmentation of the memory and the
four-segment registers may be up to 64-kilobytes long and every segment has its
own address and location. And the 8086 microprocessor works with these 64 KB segments within the whole 1MB memory. And the four 64 kilobytes segments are
positioned separately within the 1MB byte memory of the 8086 microprocessor.
Note: it should be
noted that the minimum size of the segment is 16 bytes and the maximum size is
64-kilobytes and the starting address are evenly divided by 16 in the segment. Every
address of segment has two parts that are the Segment and the Offset. Where the
segment indicates the 64kb portion of the memory and the offset indicates the
position in the 64kb portion. These are all the rules of segmentation of a
memory.
The segments and
their functions along with the offset registers are shown in the table below:
SEGMENT |
OFFSET REGISTERS |
FUNCTION |
CS |
IP |
Points address of the upcoming instruction |
DS |
BX, DI, SI |
Points the address of data |
ES |
BX, DI, SI |
Points the address of destination data of spring operations |
SS |
SP, BP |
Points address in the stack |
Advantages of Segmentation:
·
It enables the processor’s address capacity to
be extended, i.e. segmentation allows the use of 16-bit registers to have a 1
Megabyte capability.
·
It has a sophisticated memory management system.
·
It enables processes to exchange data more
easily.
·
Separate code segments may be used to perform
code-related operations.
·
Operations involving data or stack maybe
carried out in various segments.
Comments
Post a Comment
if you have any doubt, please let me know.