INTRODUCTION
The computer’s memory stores data, instructions required during the processing
of data, and output results. Storage may be required for a limited period of time,
instantly, or, for an extended period of time. Different types of memories, each
having its own unique features, are available for use in a computer. The cache
memory, registers, and RAM are fast memories and store the data and
instructions temporarily during the processing of data and instructions. The
secondary memory like magnetic disks and optical disks has large storage
capacities and store the data and instructions permanently, but are slow memory
devices. The memories are organized in the computer in a manner to achieve high
levels of performance at the minimum cost. In this lecture, we discuss different
types of memories, their characteristics and their use in the computer.
MEANING
Memory is a very essential part of the computer system as a computer cannot
process any task without it. Memory is used to store data and instructions and
then perform specific tasks on the computer system. Computer memory is a
storage space that stores and fetches data.
Memory is a set of several memory cells which are known as the building blocks
of memory. Each memory cell is assigned a unique index number or identification
number which is the unique address of that specific memory cell. CPU selects the
memory cells to read or write data.
The performance of the computer system depends on the memory and CPU. A
large set of data cannot be stored in a CPU permanently. They can only store basic
instructions required to operate the computer. Hence, it is necessary to have a
memory to run a computer system properly.
MEMORY REPRESENTATION
The computer memory stores different kinds of data like input data, output data,
intermediate results, etc., and the instructions. Binary digit or bit is the basic unit
of memory. A bit is a single binary digit, i.e., 0 or 1. A bit is the smallest unit of
representation of data in a computer. However, the data is handled by the
computer as a combination of bits. A group of 8 bits form a byte. One byte is the
smallest unit of data that is handled by the computer. One byte (8 bit) can store 2
8 = 256 different combinations of bits, and thus can be used to represent 256
different symbols. In a byte, the different combinations of bits fall in the range
00000000 to 11111111. A group of bytes can be further combined to form a
word. A word can be a group of 2, 4 or 8 bytes.
1 bit = 0 or 1
1 Byte (B) = 8 bits
1 Kilobyte (KB) = 210 = 1024 bytes
1 Megabyte (MB) = 220 = 1024KB
1 Gigabyte (GB) = 230 = 1024 MB = 1024 *1024 KB
1 Terabyte (TB) = 240= 1024 GB = 1024 * 1024 *1024 KB
TYPES OF COMPUTER MEMORY
1. PRIMARY MEMORY
Primary memory is the internal memory of a computer system. It stores and
retrieves data, instructions, and information. The CPU directly and randomly
accesses primary memory; hence primary memory is also referred to as Random
Access Memory or RAM. It is a volatile memory and loses data and instructions
when the power turns off.
o PRIMARY MEMORY CHARACTERISTICS
The computer cannot function without primary memory.
Primary memory is also known as the main memory.
You may lose data in case the power is off
Also known as volatile memory
It is the working memory of the computer.
It is faster as compared to secondary memory.
Examples: RAM, ROM, cache, PROM, EPROM, registers, etc.
TYPES OF PRIMARY MEMORY
RANDOM ACCESS MEMORY
Any system process that has to be executed is put into RAM, where it is processed
by the CPU according to the program’s instructions. If we click on an application
like Browser, the Operating System will first load browser code into RAM,
following which the CPU will execute and open the Browser.
o TYPES OF RAM
We can broadly classify RAM into SRAM or Static RAM and DRAM or Dynamic
RAM on the basis of behavior.
1. DRAM- Dynamic Random Access Memory is widely used in computer systems.
Earlier, there was a single data rate (SDR) used in computers but now, a dual data
rate (DDR) is used in them. DDR is also available in different versions such as
DDR2, DDR3 and DDR4 which are more energy efficient and provide better
performance. DRAM is made up of a transistor and a capacitor in each cell
because of which it has a leakage problem. Hence, we need to refresh a DRAM
again and again
To keep data, dynamic RAM, or DRAM, must be refreshed every few milliseconds.
DRAM is made up of capacitors and transistors, and capacitors leak electric
charge; hence DRAM must be charged on a regular basis. Because DRAM is less
expensive than SRAM, it is commonly used in personal computers and servers.
2. SRAM – Static Random Access Memory or SRAM stores the data in a static
form, meaning the data remains in the memory for as long as the computer is on.
SRAM uses a matrix of six transistors and no capacitors. Transistors do not need
the power to prevent leakage hence, we do not need to refresh SRAM again and
again
The data is stored in static RAM, or SRAM, as long as the system is powered on.
SRAM stores a bit using sequential circuits, similar to a flip-flop, so it does not
need to be refreshed on a regular basis. Because SRAM is so expensive, it’s only
used when speed is critical.
READ ONLY MEMORY
ROM stands for Read Only Memory into which the data cannot be normally written. While
the data can easily be read from this type of memory. ROM is a primary non-volatile
memory, meaning it can retain all the data in the memory without the power supply. It is a
very fast computer memory that stores the instructions required to start the computer as
soon as we connect it to the power source. When we connect the computer to the power
source, the CPU starts reading the instructions stored in ROM. It also does not require
support from the driver or any complex software to load the necessary parts of the operating
system in the primary memory.ROM can be divided into the following subcategories-
1. MROM: MROM stands for “Masked Read Only Memory”. It is a type of memory whose
contents are pre-programmed with specific functional data by the integrated circuit
manufacturer. MROM cannot enable users to change the data stored, like other types of
ROM. If it tries to do so, the process would be difficult or slow.
2. PROM: It stands for Programmable Read Only Memory and as the name suggests,
these memory are programmable. A user can program or code this memory as PROM is
manufactured as a blank memory. A PROM programmer can be used to enter a set of
programs or codes in a blank PROM. Once data or instructions are written in it, they cannot
be changed.
3. EPROM: This stands for Erasable Programmable Read Only Memory which is an
upgraded version of PROM. This type of memory allows its users to erase the stored data as
well as rewrite it. The data stored in EPROM can be erased by passing ultraviolet light for a
particular length of time using an EPROM eraser.
4. EEPROM: This stands for “Electrically Erasable Programmable Read Only Memory” and
as per its name, this memory can be programmed and erased electrically. The programming
and erasing of data takes around 4 to 10 milliseconds and this can be done around 10,000
times. EEPROM can be erased 1 byte at a time rather than erasing the entire memory at
once. Hence, the entire process is flexible but slow.
SECONDARY MEMORY
The type of memory which is attached to a computer system separately is known
as External Memory. It is also known as secondary memory or auxiliary memory
and is used to store data permanently. The CPU cannot access this type of
memory directly so data is first transferred to the primary memory and then the
CPU can access it. The secondary memory is not as fast as the primary memory.
Backup storage or mass storage media are the other names for Secondary
memory.
Secondary memory is a storage device that the CPU cannot access directly. It is a
permanent storage device.
The CPU accesses these devices through an input/output channel. The data first
transfers to primary from secondary storage before its assessment. Modern
computers often use hard drives and optical storage devices (CDs, DVDs) as
secondary storage devices.
A secondary storage device organizes data into files and directories based on a file
system. It also allows the user to access or use additional information like access
permissions, owner, last access time, etc. Also, secondary memory keeps less
used data temporarily when primary memory gets full.
Secondary memory devices are less expensive and can store vast amounts of
data, audio, video, and multimedia files. Organizations can store the equivalent of
a roomful of data on disks that consume dramatically and significantly less
physical space.
o SECONDARY MEMORY CHARACTERISTICS
These are magnetic and optical memories.
It is a type of non-volatile memory.
Data is permanently stored even when the computer is turned off
It helps store data on a computer
The computer can function without secondary memory
Slower than primary memory
Examples: magnetic tapes, optical discs, floppy disks, flash memory [USB
drives], paper tape, punched cards, etc.
TYPES OF SECONDARY MEMORY
MASS STORAGE DEVICES: The magnetic disk is a mass storage device that
provides cheap storage and can be used for both small and large devices.
There are two types of magnetic disks one is Floppy disks second is Hard disks.
FLASH/SSD: SSD stands for Solid State Drive that provides a persistent flash
memory that is very fast compared to Hard Drives. These drives are frequently
found in Mobile phones, laptops, and Mac.
OPTICAL DRIVES: This drive is a secondary storage device from which data is
read and written with the help of lasers. It can contain data up to 185TB.
Examples: CD, DVD, Blue-Ray
USB DRIVES: These are the most popular secondary storage devices that are
removable, rewritable, and very small in size.
MAGNETIC TAPE: These devices are serial access storage devices that have the
storage of a very high volume of data, and they are usually used for backups.
CACHE MEMORY-
Cache Memory is small-sized chip-based memory in a computer that lies between
the main memory and CPU. It is very close to the chip of the CPU. The aim of this
type of computer memory is to enhance the performance of the CPU. This
memory is an extremely fast memory type that acts as a buffer between RAM and
the CPU. This Memory holds frequently request data and instructions so that they
are immediately available to the CPU when needed. Cache memory is costlier
than main memory or disk memory but more than CPU registers.
DIFFERENCE BETWEEN PRIMARY MEMORY
AND SECONDARY MEMORY
Comparison
PRIMARY Memory Secondary Memory
Parameters
Primary memory is the main
Secondary memory is the external memory
Storage validity memory and stores data
and stores data permanently.
temporarily.
The CPU can directly access the
Access The CPU cannot directly access the data.
data.
Primary memory is volatile. It Secondary memory is non-volatile; data is
Volatility loses data in case of a power stored e
outage. ven during a power failure.
Data is stored inside costly Data is stored on external hardware devices
Storage
semiconductor chips. like hard drives, floppy disks, etc.
They do not have such a classification.
It can be divided into RAM and
Division Secondary memories are permanent storage
ROM
devices like CDs, DVDs, etc.
Speed Faster Slower
It saves the data that the It can save various types of data in various
Stored data
computer is currently using. formats and huge sizes.
RAM ROM
Definition of RAM is Random Access Definition of ROM is Read-only Memory
Memory
Random Access Memory (RAM) is ROM is cheaper when compared to RAM.
expensive when compared to ROM
The speed of Random Access The speed of Read-only Memory (ROM) is slower
Memory (RAM) is higher when when compared to RAM.
compared to ROM
Random Access Memory (RAM) has a ROM has a lower capacity compared to RAM
higher capacity when compared to
ROM
Data in RAM can be modified, Data in ROM can only be read, it cannot be modified
erased, or read. or erased.
The data stored in RAM is used by The data stored in ROM is used to bootstrap the
the Central Processing Unit (CPU) to computer.
process current instructions
Data stored on RAM can be accessed If the Central Processing Unit (CPU) needs to access
by the Central Processing Unit. the data on ROM, first the data must be transferred
to RAM, and then the Central Processing Unit (CPU)
will be able to access the data.
Data of RAM is very volatile, it will Data present in Read-Only Memory (ROM) is not
exist as long as there is no volatile, it is permanent. Data will remain
interruption in power. unchanged even when there is a disruption in the
power supply.
DIFFERENCE BETWEEN RAM & ROM