Memory of Computer
A computer is a device that is electronic and
that accepts data, processes that data, and gives the desired output. It
performs programmed computation with great accuracy & higher speed. Or in
other words, the computer takes data as input and stores the data/instructions
in the memory (use them when required). It then processes the data and converts
it into useful information. Finally, it gives the output. Here, input refers to
the raw data that we want the machine to process and return to us as a result,
output refers to the response that the machine provides in response to the raw
data entered and the processing of data may involve analyzing, searching,
distributing, storing data, etc. Thus, we can also call a computer data
processing system.
What
is Memory?
Computer memory is just like the human brain.
It is used to store data/information and instructions. It is a data storage
unit or a data storage device where data is to be processed and instructions
required for processing are stored. It can store both the input and output can
be stored here.
Characteristics
of Main Memory:
1. It
is faster computer memory as compare to secondary memory.
2. It
is semiconductor memories.
3. It
is usually a volatile memory.
4. It
is the main memory of the computer.
5. A
computer system cannot run without primary memory.
In general, memory is of three types:
1. Primary
memory
2. Secondary
memory
3. Cache
memory
1.Primary
Memory: It is also known as the main memory of the
computer system. It is used to store data and programs or instructions during
computer operations. It uses semiconductor technology and hence is commonly
called semiconductor memory. Primary memory is of two types:
(i)
RAM (Random Access Memory): It is a
volatile memory. Volatile memory stores information based on the power supply.
If the power supply fails/ interrupted/stopped, all the data & information
on this memory will be lost. RAM is used for booting up or start the computer.
It temporarily stores programs/ data which has to be executed by the processor.
RAM is of two types:
·
S
RAM (Static RAM): It uses transistors and the
circuits of this memory are capable of retaining their state as long as the
power is applied. This memory consists of the number of flip flops with each
flip flop storing 1 bit. It has less access time and hence, it is faster.
·
D
RAM (Dynamic RAM): It uses capacitors and
transistors and stores the data as a charge on the capacitors. They contain
thousands of memory cells. It needs refreshing of charge on capacitor after a
few milliseconds. This memory is slower than S RAM.
(ii)
ROM (Read Only Memory): It is a
non-volatile memory. Non-volatile memory stores information even when there is
a power supply failed/ interrupted/stopped. ROM is used to store information
that is used to operate the system. As its name refers to read-only memory, we
can only read the programs and data that is stored on it. 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.
ROM is of four types:
·
MROM
(Masked ROM): Hard-wired devices with a pre-programmed
collection of data or instructions were the first ROMs. Masked ROMs are a type
of low-cost ROM that works in this way.
·
PROM
(Programmable Read Only Memory): This read-only memory
is modifiable once by the user. The user purchases a blank PROM and uses a PROM
program to put the required contents into the PROM. Its content can’t be erased
once written.
·
EPROM
(Erasable Programmable Read Only Memory): It is
an extension to PROM where you can erase the content of ROM by exposing it to
Ultraviolet rays for nearly 40 minutes.
·
EEPROM
(Electrically Erasable Programmable Read Only Memory): Here
the written contents can be erased electrically. You can delete and reprogram EEPROM
up to 10,000 times. Erasing and programming take very little time, i.e., nearly
4 -10 ms (milliseconds). Any area in an EEPROM can be wiped and programmed
selectively.
2.
Secondary Memory: It is also known as auxiliary memory and
backup memory. It is a non-volatile memory and used to store a large amount of
data or information. The data or information stored in secondary memory is
permanent, and it is slower than primary memory. A CPU cannot access secondary
memory directly. The data/information from the auxiliary memory is first
transferred to the main memory, and then the CPU can access it.
Characteristics
of Secondary Memory:
·
It is a slow memory but
reusable.
·
It is a reliable and
non-volatile memory.
·
It is cheaper than primary
memory.
·
The storage capacity of
secondary memory is large.
·
A computer system can run
without secondary memory.
Types
of secondary memory:
(i)
Magnetic Tapes: Magnetic tape is a long, narrow strip of
plastic film with a thin, magnetic coating on it that is used for magnetic
recording. Bits are recorded on tape as magnetic patches called RECORDS that
run along many tracks. Typically, 7 or 9 bits are recorded concurrently. Each
track has one read/write head, which allows data to be recorded and read as a
sequence of characters. It can be stopped, started moving forward or backward,
or rewound.
(ii)
Magnetic Disks: A magnetic disc is a circular metal or a
plastic plate and these plates are coated with magnetic material. The disc is
used on both sides. Bits are stored in magnetized surfaces in locations called
tracks that run in concentric rings. Sectors are typically used to break tracks
into pieces.
(iii)
Optical Disks: It’s a laser-based storage medium that
can be written to and read. It is reasonably priced and has a long lifespan.
The optical disc can be taken out of the computer by occasional users.
Types
of Optical Disks :
(a) CD – ROM:
It’s called Compact Disk. Only read from
memory.
Information is written to the disc by using a
controlled laser beam to burn pits on the disc surface.
It has a highly reflecting surface, which is
usually aluminum.
The diameter of the disc is 5.25 inches.
16000 tracks per inch is the track density.
The capacity of a CD-ROM is 600 MB, with each
sector storing 2048 bytes of data.
The data transfer rate is about 4800KB/sec.
& the new access time is around 80 milliseconds.
(b) WORM-(WRITE ONCE READ MANY):
A user can only write data once.
The information is written on the disc using a
laser beam.
It is possible to read the written data as many
times as desired.
They keep lasting records of information but
access time is high.
It is possible to rewrite updated or new data
to another part of the disc.
Data that has already been written cannot be
changed.
Usual size – 5.25 inch or 3.5 inch diameter.
The usual capacity of 5.25 inch disk is 650
MB,5.2GB etc.
(c) DVDs:
The term “DVD” stands for “Digital
Versatile/Video Disc,” and there are two sorts of DVDs: (i)DVDR (writable) and
(ii) DVDRW (Re-Writable)
DVD-ROMS (Digital Versatile Discs): These are
read-only memory (ROM) discs that can be used in a variety of ways. When
compared to CD-ROMs, they can store a lot more data. It has a thick
polycarbonate plastic layer that serves as a foundation for the other layers.
It’s an optical memory that can read and write data.
DVD-R: It is a writable optical disc that can
be used just once. It’s a DVD that can be recorded. It’s a lot like WORM.
DVD-ROMs have capacities ranging from 4.7 to 17 GB. The capacity of 3.5 inch
disk is 1.3 GB.
3.
Cache Memory: It is a type of high-speed semiconductor
memory that can help the CPU run faster. Between the CPU and the main memory,
it serves as a buffer. It is used to store the data and programs that the CPU
uses the most frequently.
Advantages
of cache memory:
·
It is faster than the main
memory.
·
When compared to the main
memory, it takes less time to access it.
·
It keeps the programs that can
be run in a short amount of time.
·
It stores data in temporary
use.
Disadvantages
of cache memory:
·
Because of the semiconductors
used, it is very expensive.
·
The size of the cache (amount
of data it can store) is usually small.
v virtual Memory:
Virtual
memory is the feature of an operating system (OS). It is responsible for memory
management. In the Virtual Memory the Physical Memory (Hard Disk) will be
treated as the Logical Memory (random access memory (RAM)). Means with the help
of virtual Memory we can also temporarily increase the size of Logical Memory
as from the Physical Memory. A user will see or feels that all the Programs are
running into the Logical Memory of the Computer. With the help of virtual
Memory all the Space of Hard Disk can be used as the Logical Memory So that a
user can execute any Number of programs.
Virtual
Memory is a space where large programs can store themselves in form of pages
while their execution and only the required pages or portions of processes are
loaded into the main memory. This technique is useful as large virtual memory
is provided for user programs when a very small physical memory is there.
In real
scenarios, most processes never need all their pages at once, for following
reasons :
· Error
handling code is not needed unless that specific error occurs, some of which
are quite rare.
· Arrays are
often over-sized for worst-case scenarios, and only a small fraction of the
arrays are actually used in practice.
· Certain
features of certain programs are rarely used.
Benefits of Virtual Memory
1) Unused Address space: With the help of
Unused Address Space a user can execute any number of programs because all the
actual Addresses will be treated as the logical Addresses. All the Programs
those are given by the user will be Stored into the Disk Space and all the
Programs will be Stored into the Physical Address Space but they will treat as
they are Stored into the Logical Address Space.
2) Increased degree of Multiprogramming:
With the help of Virtual Memory we can Execute Many Programs at a Time because
Many Programs can be fit in the Physical Memory So that More Programs can be
Stored into the Memory but this will not increase the Response Time of the CPU
Means this will not affect on the Execution of the Programs.
3) Decrease Number of I/O Operations:
There will be less Operations those are to be used for performing the Swapping
of the Processes. All the Programs will be automatically will be loaded into
the Memory when they are needed.
But always
remember that the Whole Programs are never to be copied into the Memory Means
all the Programs will be copied into the Form of Pages Means the Parts of the Programs.
v Memory management Unit (MMU)
A memory
management unit (MMU) is a computer hardware component that handles all memory
and caching operations associated with the processor. In other words, the MMU
is responsible for all aspects of memory management. It is usually integrated
into the processor, although in some systems it occupies a separate IC
(integrated circuit) chip.
The work of
the MMU can be divided into three major categories:
1.
Hardware memory management, which oversees and regulates
the processor's use of RAM (random access memory) and cache memory.
2.
OS (operating system) memory management, which
ensures the availability of adequate memory resources for the objects and data
structures of each running program at all times.
3.
Application memory management, which allocates
each individual program's required memory, and then recycles freed-up memory
space when the operation concludes.
v DIFFERENCE BETWEEN CACHE MEMORY AND VIRTUAL
MEMORY
The main
difference between cache memory and virtual memory is that cache memory is a
storage unit that stores copies of data from frequently used main memory
locations so that the CPU can access that data faster while virtual memory is a
memory management technique that allows the user to execute programs larger
than the actual main memory.
Memory is an
important component in the computer. There are several types of memory; cache
memory and virtual memory are two of them. Cache memory is a component that is
used by the CPU to reduce the average time to access data from the main memory.
It is smaller than the main memory, but it is very fast. On the other hand,
virtual memory is a logical memory. Usually, the user programs are large than
the main memory. Virtual memory extends the capacity of the main memory so that
the user can execute large programs. In brief, the cache memory is a storage
unit while virtual memory is a memory management technique handled by the
operating system.
A Cache
memory is a high-speed memory which is used to reduce the access time for data.
On the other hands, Virtual memory is not exactly a physical memory it is a
technique which extends the capacity of the main memory beyond its limit.
The major
difference between virtual memory and the cache memory is that a virtual memory
allows a user to execute programs that are larger than the main memory whereas,
cache memory allows the quicker access to the data which has been recently
used. We will discuss some more differences with the help of comparison chart
shown below.