Ilovepdf Merged
Ilovepdf Merged
< Please do not write anything below the dotted line >
.........................................................................................................................
.......................
Marks awarded
Marks Awarded
Total
Marks
Special thanks to our professor, Nayana Dey, for their guidance and
valuable feedback, which enriched our work.
Abstract
Virtual memory is a crucial concept in modern computer
organization that allows systems to use hardware and software
to enable a memory management capability, providing an
abstraction layer over physical memory. This paper aims to
explore the principles of virtual memory, its architecture,
its implementation methods, and its impact on modern
computing. By leveraging virtual memory, systems can run
larger applications, utilize memory more efficiently, and
improve system security.
Introduction
Virtual memory is a memory management technique that allows an
operating system to use hard disk space as supplementary RAM.
It enables a computer to compensate for physical memory
shortages, creating an illusion for users of a very large (and
potentially infinite) memory space.
Paging:
The virtual address space is divided into equal size blocks
called pages and the physical (main) memory is divided into
equal size blocks called frames
Each virtual address is divided into two parts: page number
(p) and offset or displacement (d).
Operating system maintains a data structure called page table
which is used for mapping from logical address to physical
address. The page table generally contains two fields, one is
page number and other is frame number.
Segmentation:
Each virtual address is divided into two parts: page number
(p) and offset or displacement (d).
The mapping of logical address to corresponding physical
address is done using segment table
The offset must be between 0 and the segment limit. If offset
is beyond that range, the operating system generates an error
Otherwise,
It is added with the segment base to produce the address in
the physical memory for the desired word
Page fault:
When a program starts execution, one or more pages are brought
to the main memory and the page table is responsible to
indicate their positions. When the CPU needs a particular page
for execution and that page is not in main (physical) memory
(still in the secondary memory), this situation is called page
fault.
We overcome this by page replacement algorithms like FIFO
(Firstin First-out), LRU (Least Recently Used ) and optimal
page replacement algorithm.
Advantage of Virtual Memory
Performance
Virtual memory allows systems to run applications larger than
the available physical memory, improving overall system
throughput. However, excessive swapping can lead to
performance deterioration, making the choice of appropriate
algorithms critical.
Thrashing
Thrashing occurs when there is excessive paging, leading to a
significant slowdown in the system. An overloaded system
continuously swaps pages in and out of memory, causing high
latency. Techniques such as increasing physical memory or
optimizing page replacement algorithms can help mitigate this
issue.
Conclusion
Virtual memory is a fundamental aspect of computer
organization that enhances the capability and stability of
modern computing systems. By abstracting physical memory, it
allows for efficient utilization and improved security,
accommodating the growing demands of contemporary
applications. Understanding the principles and architecture of
virtual memory is crucial for system designers, programmers,
and computer scientists in leveraging technology effectively.
References
Yes
Brond?
fet eh
operondr
Drderpes.rdewe?
Hondiag
No
S1ore she
Opaose Resut
2,
Peprecent -19. 625 in TEE n9 le ond doule preeiri om
algani hm
Anc' 1o0014 O.25 2 0.5 - o
( 625)o - O.101,
19.615,
2
=(100ot, 10
Epon ent4
fon EEE Sing le paeei rion, bìas zl?9
Epoment = 4t129 = 131
Cimsng (13)o =(10000o)
Sign bit (as megotive)
fnandissa 0o|loI
.Eaponet lo29
(102),o (o0000000l)a
fornat | Sign bi+| | esponend bit (52 mardisro si4
doule paeicio
.
(upto 52 bis)
netiplieand ( ) eE 2 ymdipen (Q):-5
(-5); (101)a (2) =(oolo
m A Siae
0ol0 O000 ol o
A=A-M
ARS (AQ)
Ac
ARS(A a) d di do 2
As QLo) 0
|
-
Prod uet
(u oo), (o)
(oking 2's eomplement (oo00 lo10),=lo
2. diviion
Ans. Let cuderd (a) : l6 divi)on () +
I6 |O000
m A Q Si2e
5
Contiguadion ool oo
LS(AQ)
Ar synlA)
ne(4ene A
LS (Aa)
A=A -M
3
neston e A
LS (AQ) 0o100
LSCAQ)
AA-m
As sgaln)
-e
Restane A
oodo
LS CA)
As sigh Ln)
Ve
Restne A
Remainden (A) = 0
Quotieord Ca) -(00100); ho
Q4. Eoplain 4 bit ipple eany adden Cih
a
Goipple - eay Do
C
(3 fAO
0Mden