SlideShare a Scribd company logo
9
Most read
16
Most read
17
Most read
1) Paging:
It permits programs memory to be non-
contiguous & allowing the process to be
allocated to physical memory, when it is
available.
CPU p d f d
P
f
Physical Memory
Logical address Physical address
Page table
1. p = Page Number( is used to specify the
specific page of the process from which the
CPU wants to read the data & it is also used an
index to the page table)
2. f = Frame Number(Base Address of the frame,
where that page is stored in physical memory)
3. d= Page offset(Displacement within page, it is
used to specify the specific word(instruction) on
the page that CPU wants to read)
1) It is important to note that Logical
Memory(Secondary Memory) which is
divided into region or partition is known as
Pages.
2) While, Physical Memory(Main Memory) which
is divided into region or partition is known
as Frames.
(Source : Galvin)
32-byte memory and 4-byte pages (Source: Galvin)
Suppose we want to map instruction ‘a’ into
physical memory.
1) We first check where instruction ‘a’ exist in page
table and finds that ‘a’ is in page 0.
2) Then corresponding frame number for
instruction ‘a’ is 5 which exist in page table.
3) Then we will calculate:
(Frame no. x total no. of instructions in logical memory+ no. of
displacement of that instruction in particular block of logical
memory).
 i.e, 5x 4 + 0 = 20.
 So instruction ‘a’ will map into physical memory
at Frame Number 20.
1) It allows to store parts of a single process in
a non-contiguous fashion.
2) It solves the problem of external
fragmentation.
1) It suffers from internal fragmentation.
2) Problem to maintain page table for each
process.
3) Time taken to fetch instruction increases
since now two memory accesses are
required.
1)Like paging, segmentation is another non-
contiguous memory allocation technique.
2) In Segmentation, process is not divided into
fixed size pages, rather is divided into modules
for better visualization.
3) Segmentation is variable size partitioning
scheme
4) In segmentation, logical memory & physical
memory are divide into partitions of unequal
size.
5) Size of partitions depend on length of modules.
6) In segmentation, the memory is divided into the
variable size parts. Each part is known as segment
which can be allocated to a process.
7) Memory-management scheme that supports user
view of memory.
8) A program is a collection of segments
◦ A segment is a logical unit such as:
main program, procedure, function, method,
object, local variables, global variables, stack,
arrays etc.
 The details about each segment are stored in a
table called as segment table.
Source: Galvin
CPU s d
Physical Memory
Logical address
< +
Trap, Error
Seg no.
Limit Base
Segment table
No
Yes
Segment No.
Segment Offset
Length of Segment
Seg No. Base Length
1 02 6
2 24 7
3 14 4
c
02
07
14
17
24
30
PM
Library
Stack
Program
LM
Segment Table
a
b
c
d
m
n
u
v
w
 Consider the following segment table:
What are the physical address for the following
logical address?
i) <0,435> ii) <2,500> iii) <1,10>
Segment
No.
Base Length
0 219 600
1 2300 14
2 90 100
3 1327 586
4 1952 96
1) Solve problem of internal fragmentation.
2) It divides program into module provides
better visualization.
3) Segment table consumes less space as
compare to page table in paging.
1) Problem to maintain a segment table for
each process.
2) Time taken to fetch instruction increases
since now two memory accesses are
required.
3) Segments of unequal size are not suited for
swapping.
4) Suffers from external fragmentation.
System using a paging and segmentation, the
virtual address space consists of up to 8
segments where each segment can be up to
229 byte long. The hardware pages each
segment into 256 bytes pages. How many
bits in the virtual address specify the
 1) Segment number?
 2) Page number ?
 3) Offset within page?
 4) Entire virtual address?
Ans: 1) segment number: virtual address space consists up to 8
segments. So 8 = 23
Since 3 bits are needed to specify segment number.
2) Page number: Hardware pages each segment into 256 byte pages. So
256 = 28 byte page
Size of segment is 229 bytes.
Since 229 / 28 = 229-8 = 221 = 21 pages
Since 21 bits are required to specify the page number.
3) Offset within the page: for 28 byte page, 8 bits are needed.
4) Entire virtual address:
= segment number + page number + offset
= 3 + 21 + 8 = 32.

More Related Content

PPT
Introduction to data structures and Algorithm
PPTX
process control block
PDF
Intermediate code generation in Compiler Design
PPTX
Segmentation in operating systems
PPT
B trees dbms
PPTX
Presentation on Segmentation
PDF
Run time storage
PPTX
serializability in dbms
Introduction to data structures and Algorithm
process control block
Intermediate code generation in Compiler Design
Segmentation in operating systems
B trees dbms
Presentation on Segmentation
Run time storage
serializability in dbms

What's hot (20)

PPTX
Chapter-7 Relational Calculus
PPTX
DBMS - RAID
PPTX
Distributed database management system
PPTX
Operating system memory management
PPTX
Critical section problem in operating system.
PPTX
Pci,usb,scsi bus
PPT
Paging.ppt
PPTX
Concurrency control
PPTX
Set associative mapping
PPTX
Process in operating system
PDF
Deadlock Avoidance - OS
PPTX
Process synchronization in Operating Systems
PPTX
Inter Process Communication
PPTX
DeadLock in Operating-Systems
PPTX
Auxiliary memory
PPT
Operating System: Deadlock
PPTX
Query processing and optimization (updated)
PDF
Methods for handling deadlocks
PPTX
Cache Memory
Chapter-7 Relational Calculus
DBMS - RAID
Distributed database management system
Operating system memory management
Critical section problem in operating system.
Pci,usb,scsi bus
Paging.ppt
Concurrency control
Set associative mapping
Process in operating system
Deadlock Avoidance - OS
Process synchronization in Operating Systems
Inter Process Communication
DeadLock in Operating-Systems
Auxiliary memory
Operating System: Deadlock
Query processing and optimization (updated)
Methods for handling deadlocks
Cache Memory
Ad

Similar to Paging & segmentation; advantages and disadvantage (20)

PPTX
Memory management
DOCX
PAGIN AND SEGMENTATION.docx
PPTX
Paging and Segmentation
PPTX
Paging and Segmentation in Operating System
PPTX
os ppt.pptx
PPTX
Memory management in operating system | Paging | Virtual memory
PDF
CSI-503 - 8.Paging and Segmentation
PPTX
Paging and segmentation
PPTX
Combined paging and segmentation
PPT
unit-4 class (2).ppt,Memory managements part-1
PPTX
Memory Managment(OS).pptx
PPTX
Paging +Algorithem+Segmentation+memory management
PPTX
Main Memory Management in Operating System
PPT
Csc4320 chapter 8 2
PPTX
VIRTUAL MEMORY
PPTX
Os unit 2
PPT
Segmentation geekssay.com
Memory management
PAGIN AND SEGMENTATION.docx
Paging and Segmentation
Paging and Segmentation in Operating System
os ppt.pptx
Memory management in operating system | Paging | Virtual memory
CSI-503 - 8.Paging and Segmentation
Paging and segmentation
Combined paging and segmentation
unit-4 class (2).ppt,Memory managements part-1
Memory Managment(OS).pptx
Paging +Algorithem+Segmentation+memory management
Main Memory Management in Operating System
Csc4320 chapter 8 2
VIRTUAL MEMORY
Os unit 2
Segmentation geekssay.com
Ad

Recently uploaded (20)

PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPT
Project quality management in manufacturing
PPTX
Lecture Notes Electrical Wiring System Components
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
Construction Project Organization Group 2.pptx
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
Welding lecture in detail for understanding
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
Digital Logic Computer Design lecture notes
PPTX
Geodesy 1.pptx...............................................
PPTX
additive manufacturing of ss316l using mig welding
PDF
PPT on Performance Review to get promotions
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Project quality management in manufacturing
Lecture Notes Electrical Wiring System Components
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Construction Project Organization Group 2.pptx
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
R24 SURVEYING LAB MANUAL for civil enggi
Welding lecture in detail for understanding
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Embodied AI: Ushering in the Next Era of Intelligent Systems
Digital Logic Computer Design lecture notes
Geodesy 1.pptx...............................................
additive manufacturing of ss316l using mig welding
PPT on Performance Review to get promotions

Paging & segmentation; advantages and disadvantage

  • 1. 1) Paging: It permits programs memory to be non- contiguous & allowing the process to be allocated to physical memory, when it is available.
  • 2. CPU p d f d P f Physical Memory Logical address Physical address Page table
  • 3. 1. p = Page Number( is used to specify the specific page of the process from which the CPU wants to read the data & it is also used an index to the page table) 2. f = Frame Number(Base Address of the frame, where that page is stored in physical memory) 3. d= Page offset(Displacement within page, it is used to specify the specific word(instruction) on the page that CPU wants to read)
  • 4. 1) It is important to note that Logical Memory(Secondary Memory) which is divided into region or partition is known as Pages. 2) While, Physical Memory(Main Memory) which is divided into region or partition is known as Frames.
  • 6. 32-byte memory and 4-byte pages (Source: Galvin)
  • 7. Suppose we want to map instruction ‘a’ into physical memory. 1) We first check where instruction ‘a’ exist in page table and finds that ‘a’ is in page 0. 2) Then corresponding frame number for instruction ‘a’ is 5 which exist in page table. 3) Then we will calculate: (Frame no. x total no. of instructions in logical memory+ no. of displacement of that instruction in particular block of logical memory).  i.e, 5x 4 + 0 = 20.  So instruction ‘a’ will map into physical memory at Frame Number 20.
  • 8. 1) It allows to store parts of a single process in a non-contiguous fashion. 2) It solves the problem of external fragmentation.
  • 9. 1) It suffers from internal fragmentation. 2) Problem to maintain page table for each process. 3) Time taken to fetch instruction increases since now two memory accesses are required.
  • 10. 1)Like paging, segmentation is another non- contiguous memory allocation technique. 2) In Segmentation, process is not divided into fixed size pages, rather is divided into modules for better visualization. 3) Segmentation is variable size partitioning scheme 4) In segmentation, logical memory & physical memory are divide into partitions of unequal size. 5) Size of partitions depend on length of modules.
  • 11. 6) In segmentation, the memory is divided into the variable size parts. Each part is known as segment which can be allocated to a process. 7) Memory-management scheme that supports user view of memory. 8) A program is a collection of segments ◦ A segment is a logical unit such as: main program, procedure, function, method, object, local variables, global variables, stack, arrays etc.  The details about each segment are stored in a table called as segment table.
  • 13. CPU s d Physical Memory Logical address < + Trap, Error Seg no. Limit Base Segment table No Yes Segment No. Segment Offset Length of Segment
  • 14. Seg No. Base Length 1 02 6 2 24 7 3 14 4 c 02 07 14 17 24 30 PM Library Stack Program LM Segment Table a b c d m n u v w
  • 15.  Consider the following segment table: What are the physical address for the following logical address? i) <0,435> ii) <2,500> iii) <1,10> Segment No. Base Length 0 219 600 1 2300 14 2 90 100 3 1327 586 4 1952 96
  • 16. 1) Solve problem of internal fragmentation. 2) It divides program into module provides better visualization. 3) Segment table consumes less space as compare to page table in paging.
  • 17. 1) Problem to maintain a segment table for each process. 2) Time taken to fetch instruction increases since now two memory accesses are required. 3) Segments of unequal size are not suited for swapping. 4) Suffers from external fragmentation.
  • 18. System using a paging and segmentation, the virtual address space consists of up to 8 segments where each segment can be up to 229 byte long. The hardware pages each segment into 256 bytes pages. How many bits in the virtual address specify the  1) Segment number?  2) Page number ?  3) Offset within page?  4) Entire virtual address?
  • 19. Ans: 1) segment number: virtual address space consists up to 8 segments. So 8 = 23 Since 3 bits are needed to specify segment number. 2) Page number: Hardware pages each segment into 256 byte pages. So 256 = 28 byte page Size of segment is 229 bytes. Since 229 / 28 = 229-8 = 221 = 21 pages Since 21 bits are required to specify the page number. 3) Offset within the page: for 28 byte page, 8 bits are needed. 4) Entire virtual address: = segment number + page number + offset = 3 + 21 + 8 = 32.