0% found this document useful (0 votes)
23 views

MEMORY MANAGEMENT

Uploaded by

Adithyan Cp
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)
23 views

MEMORY MANAGEMENT

Uploaded by

Adithyan Cp
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
You are on page 1/ 25

COMPUTER ORGANIZATION AND

ARCHITECTURE
MEMORY MANAGEMENT
BASIC CONCEPTS

• Memory management is the process of controlling and coordinating a computer's


main memory. It ensures that blocks of memory space are properly managed and
allocated so the operating system, applications and other running processes have
the memory they need to carry out their operations.
• As part of this activity, memory management takes into account the capacity
limitations of the memory device itself, deallocating memory space when it is no
longer needed or extending that space through virtual memory.
• Memory management strives to optimize memory usage so the CPU can efficiently
access the instructions and data it needs to execute the various processes.
SEMICONDUCTOR RAM

• Random Access Memory is a form of semiconductor memory technology that is


applied for reading and writing data in any order.
• It is used for such purposes as the computer or processor memory where variables
and others are stored and are needed on a random basis.
• Data can be stored and read many times to and from this type of memory.
• In RAM the memory arranged in such a way that any memory location requires
equal time for reading and writing.
• Random Access Memory is volatile (Volatile memories are those memories that
store the data tentatively. More precisely one can understand that data saved in
volatile memory remains only till the power supply is ON. Once the supply gets OFF
the stored data would get lost) memory alternatively referred to as main memory,
primary memory, or system memory.
• Random access memory can be easily programmed, erased and reprogrammed by
the user therefore is used in immense quantities in computer applications as current
day computing and processing technology demands large amounts of memory to
empower them to handle the memory requirements.
• Types of RAM
• SRAM (Static Random Access Memory)
• DRAM (Dynamic Random Access Memory)
STATIC RAM (SRAM)

• SRAM full form is Static Random Access Memory. It possesses an array of flip-flops
that are used to save the data. The memory cells consists of flip flops that hold the
information till the power supply is on.
• The word static implies that the memory holds its contents as long as the electricity
is being supplied and the data is dumped when the power gets down because of its
volatile nature.
• Static RAM”s are more expensive and consume more power and also have higher
speeds than D-RAMs.
• Static RAM is used to build the CPU”s speed-sensitive cache, while dynamic RAM
forms the larger system RAM space.
DYNAMIC RAM (DRAM)

• DRAM (Dynamic Random Access Memory) stores the data in the form of charges in
the capacitor and transistor pair available in the memory cell . DRAM is
implemented using MOSFETs.
• The Dynamic Random Access Memory needs to be regularly refreshed so that the
data should be maintained. This is achieved by installing the memory on a refresh
circuit that rewrites the content several hundred times every second. It dissipates
less power ass compared to SRAM and operates at a slower rate than as well.
• DRAM is installed for system memory as it is relatively cheap and small. It consists
of memory cells, which constitute a single capacitor and a single transistor.
ROM

• ROM stands for Read-Only Memory. It is a non-volatile memory that is used to stores
important information which is used to operate the system. As its name refers to
read-only memory, we can only read the programs and data stored on it. It is also a
primary memory unit of the computer system. It contains some electronic fuses that
can be programmed for a piece of specific information. The information stored in
the ROM in binary format. It is also known as permanent memory.
• TYPES OF ROM:

1. MROM (Masked read-only memory)


2. PROM (Programmable read-only memory)
3. EPROM (Erasable programmable read-only memory)
4. EEPROM (Electrically erasable programmable read-only memory)
• 1. MROM (Masked read-only memory): We know that ROM is as old as
semiconductor technology.
• MROM was the very first ROM that consists of a grid of word lines and bit lines
joined together transistor switches.
• This type of ROM data is physically encoded in the circuit and only be programmed
during fabrication. It was not so expensive.
• 2. PROM (Programmable read-only memory): PROM is a form of digital memory.
In this type of ROM, each bit is locked by a fuse or anti-fuse.
• The data stored in it are permanently stored and can not be changed or erasable. It
is used in low-level programs such as firmware or microcode.
• 3. EPROM (Erasable programmable read-only memory): EPROM also called
EROM, is a type of PROM but it can be reprogrammed.
• The data stored in EPROM can be erased and reprogrammed again by ultraviolet
light. Reprogrammed of it is limited. Before the era of EEPROM and flash memory,
EPROM was used in microcontrollers.
• 4. EEPROM (Electrically erasable programmable read-only memory): As its
name refers, it can be programmed and erased electrically. The data and program of
this ROM can be erased and programmed about ten thousand times.
• The duration of erasing and programming of the EEPROM is near about 4ms to
10ms. It is used in microcontrollers and remote keyless systems.
Advantages of ROM:
• It is cheaper than RAM and it is non-volatile memory.
• It is more reliable as compared to RAM.
• Its circuit is simple as compared to RAM.
• It doesn’t need refreshing time because it is static.
• It is easy to test.

Disadvantages of ROM:
• It is a read-only memory, so it cannot be modified.
• It is slower as compared to RAM.
Difference RAM ROM

Read/Write Read and write operations are supported Only read operations are supported

It is typically used to store firmware or microcode,


Used to store the data that has to be
Use which is used to initialize and control hardware
currently processed by CPU temporarily.
components of the computer

Speed It is a high-speed memory. It is much slower than the RAM.

Large size with higher capacity, with respect


Size and Capacity Small size with less capacity, with respect to RAM
to ROM

Cost Costlier cheaper than RAM.

A RAM chip can store only a few gigabytes A ROM chip can store multiple megabytes (MB) of
Chip Size
(GB) of data. data.

Used for temporary storage of data currently Used to store firmware, BIOS, and other data that
Function
being processed by CPU needs to be retained
PERFORMANCE CONSIDERATION
• Computer performance is the amount of work accomplished by a
computer system. The word performance in computer performance means
“How well is the computer doing the work it is supposed to do?”. It basically
depends on response time, throughput and execution time of a computer
system.
• Response time is the time from start to completion of a task. This also
includes:
i. Operating system overhead.
ii. Waiting for I/O and other processes
iii. Accessing disk and memory
iv. Time spent executing on the CPU or execution time.
Performance is determined by execution time as performance is inversely proportional to execution
time.

Performance = (1 / Execution time)


And,
(Performance of A / Performance of B) = (Execution Time of B / Execution Time of A)

If given that Processor A is faster than processor B, that means execution time of A is less than that of
execution time of B. Therefore, performance of A is greater than that of performance of B.

Example –
Machine A runs a program in 100 seconds, Machine B runs the same program in 125 seconds

(Performance of A / Performance of B) = (Execution Time of B / Execution Time of A) = 125 / 100 = 1.25


That means machine A is 1.25 times faster than Machine B.

And, the time to execute a given program can be computed as:


Execution time = CPU clock cycles x clock cycle time
IMPROVE PERFORMANCE
• To improve performance you can either:
• Decrease the CPI (clock cycles per instruction) by using new
Hardware.
• Decrease the clock time or Increase clock rate by reducing
propagation delays or by use pipelining.
• Decrease the number of required cycles or improve ISA or Compiler.
MEMORY MANAGEMENT REQUIREMENTS
• Relocation – The available memory is generally shared among a number of
processes in a multiprogramming system, so it is not possible to know in advance
which other programs will be resident in main memory at the time of execution of
this program. Swapping the active processes in and out of the main memory enables
the operating system to have a larger pool of ready-to-execute process.

When a program gets swapped out to a disk memory, then it is not always possible
that when it is swapped back into main memory then it occupies the previous
memory location, since the location may still be occupied by another process. We
may need to relocate the process to a different area of memory. Thus there is a
possibility that program may be moved in main memory due to swapping.
• Protection – There is always a danger when we have multiple programs at
the same time as one program may write to the address space of another
program. So every process must be protected against unwanted interference
when other process tries to write in a process whether accidental or incidental.
• Between relocation and protection requirement a trade-off occurs as the
satisfaction of relocation requirement increases the difficulty of satisfying the
protection requirement.

• Prediction of the location of a program in main memory is not possible, that’s


why it is impossible to check the absolute address at compile time to assure
protection. Most of the programming language allows the dynamic calculation
of address at run time.
• The memory protection requirement must be satisfied by the processor rather
than the operating system because the operating system can hardly control a
process when it occupies the processor. Thus it is possible to check the validity
of memory references.
• Sharing – A protection mechanism must have to allow several processes to access
the same portion of main memory.
• Allowing each processes access to the same copy of the program rather than have
their own separate copy has an advantage.

• For example, multiple processes may use the same system file and it is natural to
load one copy of the file in main memory and let it shared by those processes.
• It is the task of Memory management to allow controlled access to the shared areas
of memory without compromising the protection. Mechanisms are used to support
relocation supported sharing capabilities.
• Logical organization – Main memory is organized as linear or it can be a one-
dimensional address space which consists of a sequence of bytes or words. Most of
the programs can be organized into modules, some of those are unmodifiable (read-
only, execute only) and some of those contain data that can be modified.
• To effectively deal with a user program, the operating system and computer
hardware must support a basic module to provide the required protection and
sharing.
Advantages:
• Modules are written and compiled independently and all the references from one
module to another module are resolved by `the system at run time.
• Different modules are provided with different degrees of protection.
• There are mechanisms by which modules can be shared among processes. Sharing
can be provided on a module level that lets the user specify the sharing that is
desired.
• Physical organization – The structure of computer memory has two levels referred
to as main memory and secondary memory. Main memory is relatively very fast and
costly as compared to the secondary memory. Main memory is volatile. Thus
secondary memory is provided for storage of data on a long-term basis while the
main memory holds currently used programs.
• The major system concern between main memory and secondary memory is the
flow of information to understand this for two reasons:

• The programmer may engage in a practice known as overlaying when the main
memory available for a program and its data may be insufficient. It allows
different modules to be assigned to the same region of memory. One
disadvantage is that it is time-consuming for the programmer.
• In a multiprogramming environment, the programmer does not know how
much space will be available at the time of coding and where that space will be
located inside the memory.
SECONDARY STORAGE
• Secondary storage is computer memory that is not directly accessible to the CPU of a
computer, requiring the use of computer’s input/output channels.
• It is used to store data that is not in active use.
• It is usually slower than primary storage but it always has higher storage capacity.
• It is non-volatile. Data remains unchanged even after switching off the computer.
FIXED STORAGE

• In secondary memory, a fixed storage is an internal media device that is used to store data
in a computer system. Fixed storage is generally known as fixed disk drives or hard drives.
• Generally, the data of the computer system is stored in a built-in fixed storage device.
• Fixed storage does not mean that you can not remove them from the computer system,
you can remove the fixed storage device for repairing, for the upgrade, or for maintenance,
etc. with the help of an expert or engineer.
Types of fixed storage:
Following are the types of fixed storage:
• Internal flash memory (rare)
• SSD (solid-state disk)
• Hard disk drives (HDD)
SECONDARY STORAGE DEVICES

You might also like