0% found this document useful (0 votes)
10 views15 pages

Ilovepdf Merged

ca2 assignment makaut co

Uploaded by

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

Ilovepdf Merged

ca2 assignment makaut co

Uploaded by

Aritra Das
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

B. P.

Poddar Institute of Management and Technology

Term Paper Details

Paper Name: COMPUTER ORGANIZATION

Paper Code : PCC-CS302

Term Paper Title: VIRTUAL MEMORY

Stream & Section: CSE A


Semester: 3
Academic Year: 2024-25

Sl.no Name University Roll No.

1 ARITRA DAS 11500123037

< Please do not write anything below the dotted line >
.........................................................................................................................
.......................

Marks awarded
Marks Awarded
Total
Marks

Signature of Faculty with date______________________


ACKNOWLEDGEMENT

I would like to extend my heartfelt appreciation to every sources


who contributed to the successful completion of this project. My
sincere thanks go to our project team members for their dedication
and collaboration throughout the project. Each member played a
significant role in shaping the outcome.

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.

Address Space and Logical Addressing

Logical Address:- A logical address, also known as a virtual


address, is an address generated by the CPU during program
execution. It is the address seen by the process and is
relative to the program’s address space.

Physical Address:- A physical address is the actual address in


the main memory where data is stored. It is a location in
physical memory, as opposed to a virtual address.
Advantage of Logical Address over Physical Address:-

1. Eliminates need of purchasing additional RAM.


2. Allows to run programs of size larger than physical memory
3. Improves Efficiency and Multitasking

Architecture of Virtual Memory

Memory Management Unit (MMU)


The physical hardware of a computer that manages its virtual
memory and caching functions is called the memory management
unit (MMU). It is typically found inside the central
processing unit (CPU) of the computer. The MMU receives all
inputs for data requests and decides whether to retrieve the
data from ROM or RAM storage.
Mapping method
MMU uses a special register called base register or relocation
register. The content of the relocation register is added to
every logical address generated by the user program at the
beginning of execution.
For example, if the relocation register holds an address value
2000, then a reference to the location 0 by the user is
dynamically relocated to 2000 address. A reference to the
address 150 is mapped to the address 2150

Implementation of Virtual Memory

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

1. Memory Abstraction: It provides a single contiguous


address space to applications, abstracting physical
address limitations.
2. Process Isolation: It allows multiple processes to execute
simultaneously without interference, enhancing security
and stability.
3. Efficient Memory Utilization: It provides mechanisms for
efficient allocation and sharing of memory resources among
processes.

Disadvantage 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.

Applications of Virtual Memory

• Operating Systems: Used in Windows, Linux, macOS for


efficient memory management.
• Large Applications: Supports running databases,
simulations, and graphic-intensive software.
• Cloud Computing: Essential for virtual machines and cloud
services, enabling resource allocation.
• Multitasking: Allows multiple applications to run
simultaneously on a single system.
• Gaming: Supports running large, resource-intensive games
on systems with limited physical memory.

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

Computer Organization and Architecture- by Tarun Kumar Ghosh-


Tata Mc Graw Hill Publishing Company Limited
Virtual Memory in Operating System - GeeksforGeeks
Logical and Physical Address in Operating System -
GeeksforGeeks
Difference Between Paging and Segmentation - GeeksforGeeks
Nomei Anitna as CJassi- CSE-A
Semi. Bnd Yean 2nd

1: Desewbe dihlones Uypes o, od dheging modee. Derenibe


açtnuetion (Ade Cui th pnopen low chan.

Ans': follauing ane the dpes a adduess mad e c:


Tonpbed (or inhener) mde ;. Tn this node Jhe
oporonds On e indicated impliei y by he ins4nuelon.
2. Tmmed at e mocde: Dn thic mocde he operand is mendionrd
enplaty
3. Ctok oddnersing
insnuedion.
mode: Siock ad dressing computen s uce
Gtaek od dyerred inçuctior.
4. Re gisnen Cdinre) made' T, ir made she paocest negislens
hol d
he openand
5. Regirten indineel mdei. 1a his mocde he inrin«ehion
<peifies an ad drers o cpo ne girten ha haldr he
ac dres o he yperand memany
audo deenemet mde'. bic is fiilan
egic4en imùnect mnode eepd hat ofer beyone
hegisten's conteat is used do acesr memong
incnemnented an deenemented
4. Dincct obsodute addne rciag mle!. n Ais msde he
iaç1uelion contains he memasy addere o dhe openond
he inrtnuti on
addness mode'- Ta dis made
8. cheet oddnesc in its ad dners fjald.
9ives memoy mode pc-nalative addnecs mocd e:
9. Resative Oddess dive addess is obdained by ad ding he
Da dhi moce, he etle
negisten Cuith addhese pand o
progom counten (Pc)
tontent ot
Uhe insuetion,
Pmdexed addness ode' n dhis made, dhe e<dive
|9,
ddernined by addihg he cordent o inde
addness is
negisten (i)
|. Bace Aegis ter addes[ made. ((his mde is ured tan
reloeation of he prognam in dhe memay
follocing ane dhe
be divided indo
teps o
5 maj n phaer,
|. fedch he insuedion tnom mem
2.Detade he insnuction
3. felh dhe gperond nom memm egisten
4. Eneute she Cuhde ingtaulio
5. Stane the oudput nesut do he memany negisen
feteh instn
ynom mems
Oeeode

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

Isign bit 8 enponed bit | 23 nand isra bi


fonnat
CEEL single pnerion!

doule precsion bias J023

.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
|
-

ALS [Aa) Oolo

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

Suitoble block ciamen diagnom using a l odder.


Ans': 4 bit pple cony Adden is a diyital feinrat
tht odds two bi 1bi i bimorg numbenr ond droder
ef a
Ahed eang eoy-ot bi4.
Sum al ong Cuidh a
Comgomendr bit gigple eoy adden'
odd
( Fuu adden Ahu odde is inrud that
and
cong bir (Ci)
(Cout)
eas cadec
ARigple Covny Adder' malliple u odder s -ad eah addes
do add m ent. he toden
bit bimay numbens
o the neat
s com ne ted o he cany
Ripple Cang Adden;.
4-bit
addi ng a pain o bidr
" Each c addes erpoonrsle on
is Sherp bit ad diti
.
Ynor dhe pevibus douen
adong carvgy -inset ic to 0,
set
he tit ul adden 's i ndo he
eoch adden eip ple
dhe name
henee

Goipple - eay Do

C
(3 fAO

0Mden

You might also like