0 ratings0% found this document useful (0 votes) 32 views18 pagesComputer Science Unit-3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
Memory Hierarchy
What is Memory Hierarchy?
The memory in a computer can be divided into five hierarchies based on the
speed as well as use. The processor can move from one level to another based
on its requirements. The five hierarchies in the memory are registers, cache,
main memory, magnetic discs, and magnetic tapes. The first three hierarchies
are volatile memories which mean when there is no power, and then
automatically they lose their stored data. Whereas the last two hierarchies are
not volatile which means they store the data permanently.
A memory element is the set of storage devices which stores the binary data in
the type of bits. In general, the storage of memory can be classified into two
categories such as volatile as well as non- volatile.
Memory Hierarchy in Computer Architecture
The memory hierarchy design in a computer system mainly includes different
storage devices. Most of the computers were inbuilt with extra storage to run
more powerfully beyond the main memory capacity. The following memory
hierarchy diagram is a hierarchical pyramid for computer memory. The
designing of the memory hierarchy is divided into two types such as primary
(Internal) memory and secondary (External) memory.
Increasing order of
Access Time Ratio
Memory
Magnetic Disks
Magentic Tapes
Auxillary
MemoryPrimary Memory
The primary memory is also known as internal memory, and this is accessible
by the processor straightly. This memory includes main, cache, as well as CPU
registers,
Secondary Memory
The secondary memory is also known as external memory, and this is accessible
by the processor through an input/output module. This memory includes an
optical disk, magnetic disk, and magnetic tape.
Characteristics of Memory Hierarchy
The memory hierarchy characteristics mainly include the following.
Performance
Previously, the designing of a computer system was done without memory
hierarchy, and the speed gap among the main memory as well as the CPU
registers enhances because of the huge disparity in access time, which will
cause the lower performance of the system. So, the enhancement was
mandatory. The enhancement of this was designed in the memory hierarchy
model due to the system’s performance increase.
Ability
The ability of the memory hierarchy is the total amount of data the memory can
store. Because whenever we shift from top to bottom inside the memory
hierarchy, then the capacity will increase.
Access Time
The access time in the memory hierarchy is the interval of the time among the
data availability as well as request to read or write. Because whenever we shift
from top to bottom inside the memory hierarchy, then the access time will
increase
Cost per bitWhen we shift from bottom to top inside the memory hierarchy, then the cost
for each bit will increase which means an internal Memory is expensive
compared with external memory.
Memory Hierarchy Design
The memory hierarchy in computers mainly includes the following.
Registers
Usually, the register is a static RAM or SRAM in the processor of the computer
which is used for holding the data word which is typically 64 or 128 bits. The
program counter register is the most important as well as found in all the
processors. Most of the processors use a status word register as well as an
accumulator, A status word register is used for decision making, and the
accumulator is used to store the data like mathematical operation. Usually,
computers like complex instruction set computers have so many registers for
accepting main memory, and RISC- reduced instruction set computers have
more registers.
Cache Memory
Cache memory can also be found in the processor, however rarely it may be
another IC (integrated circuit) which is separated into levels. The cache holds
the chunk of data which are frequently used from main memory. When the
processor has a single core then it will have two (or) more cache levels rarely.
Present multi-core processors will be having three, 2-levels for each one core,
and one level is shared.
Main Memory
The main memory in the computer is nothing but, the memory unit in the CPU
that communicates directly. It is the main storage unit of the computer. This
memory is fast as well as large memory used for storing the data throughout the
operations of the computer. This memory is made up of RAM as well as ROM.
Magnetic Disks
The magnetic disks in the computer are circular plates fabricated of plastic
otherwise metal by magnetized material. Frequently, two faces of the disk are
utilized as well as many disks may be stacked on one spindle by read or write
heads obtainable on every plane. Alll the disks in computer turn jointly at high
speed. The tracks in the computer are nothing but bits which are stored withinthe magnetized plane in spots next to concentric circles. These are usually
separated into sections which are named as sectors.
Magnetic Tape
This tape is a normal magnetic recording which is designed with a slender
magnetizable covering on an extended, plastic film of the thin strip. This is
mainly used to back up huge data. Whenever the computer requires to access a
strip, first it will mount to access the data. Once the data is allowed, then it will
be unmounted. The access time of memory will be slower within magnetic strip
as well as it will take a few minutes for accessing a strip.
Advantages of Memory Hierarchy
The need for a memory hierarchy includes the following.
© Memory distributing is simple and economical
. Removes external destruction
* Data can be spread all over
* Permits demand paging & pre-paging
© Swapping will be more proficientPrimary and Secondary Memory
What is Primary Memory?
Primary memory is the main memory of the computer system. Accessing data from primary
memory is faster because it is an internal memory of the computer. The primary memory is most
volatile which means data in primary memory does not exist if it is not saved when a power failure
occurs.
The primary memory is a semiconductor memory. It is costlier compared with secondary memory.
The capacity of primary memory is very much limited and is
always smaller compares to secondary memory. ripen Lan
‘Two types of Primary Memory are:
. RAM RAM ROM
PROM
. cow SRAM DRAM. a
RAM (Random Access Memory) EEPROM
Random access memory which is also known as RAM is
generally known as a main memory of the computer system. It is called temporary memory or cache
memory. The information stored in this type of memory is lost when the power supply to the PC or
laptop is switched off.
ROM (Read Only Memory)
It stands for Read Only Memory. ROM is a permanent type of memory. Its content is not lost when
the power supply is switched off. The computer manufacturer decides the information of ROM, and
it is permanently stored at the time of manufacturing which can not be overwritten by the user.
Characteristic of Primary Memory
+ The computer can't run without primary memory
+ Itis known as the main memory.
+ You can lose data in case power is switched off
+ Itis also known as volatile memory
+ Itisa working memory of the computer.
+ Primary memory is faster compares to secondary memory.
What is Secondary Memory?
All secondary storage devices which are capable of storing high volume data is referred to
secondary memory. It's slower than primary memory. However, it can save a substantial amount of
data, in the range of gigabytes to terabytes. This memory is also called backup storage or mass
storage media.
‘Types of Secondary memory
Mass storage devices:
‘The magnetic disk provides cheap storage and is used for both small and large computer systems.
‘Two types of magnetic disks are:
© Floppy disks
. Hard disksFlash/SSD
Solid State Drive provides a persistent flash memory. It's very fast compared to Hard Drives.
Frequently found in Mobile phones, its rapidly being adopted in PC/Laptop/Mac.
Optical drives:
This secondary storage device is from which data is read and written with the help of lasers. Optical
disks can hold data up to 185 TB.
Examples
° cD
. DVD
* Blue Ray
USB drives:It is one of the most popular types of secondary storage device available in the market.
USB drives are removable, rewritable and are physically very small. The capacity of USB drives is
also increasing significantly as today 1B pen drive is also available in the market.
Magnetic tape:It is a serial access storage device which allows us to store a very high volume of
data. Usually used for backups.
Characteristic Secondary Memory
* These are magnetic and optical memories
* Secondary memory is known as a backup memory
© Itis a non-volatile type of memory
* Data is stored permanently even when the power of the computer is switched off
+ Ithelps store data in a computer
© The machine can run without secondary memory
* Slower than primary memory
Primary Memory V/S Secondary Memory
Parameter Primary memory Secondary memory
The primary memory is categorized as The secondary memory is always a non-
jature
volatile & nonvolatile memories. volatile memory.
i ‘These memories are also called internal Secondary memory is known as a Backup
Alias memory or Additional memory or Auxiliary
‘memory.
memory.
Data cannot be accessed directly by the
yn Data is directly accessed by the processor. It is first copied from secondary
ccess
processing unit. memory to primary memory. Only then CPU
can access it.
It's a volatile memory meaning data
Formation cannot be retained in case of power
failure.
It's a non-volatile memory so that that data
can be retained even after power failure.
Itholds data or information that is _It stores a substantial amount of data and
Storage currently being used by the processing information. Capacity is generally from
unit. Capacity is usually in 16 to 32 GB 200GB to tera bytes.
Primary memory can be accessed by Secondary memory is accessed by /O
the data bus. channels.
Primary memory is costlier than Secondary memory is cheaper than primary
secondary memory. memory.
Accesses
Expense