Unit 4 Memory: Basic concept and hierarchy
Memory is the electronic storage space where a computer keeps the instructions and data it needs
to access quickly. It's the place where information is stored for immediate use. Memory is an
important component of a computer, as without it, the system wouldn’t operate correctly. The
computer’s operating system (OS), hardware, and software all rely on memory to function
properly.
A computer system consists of various types of memory devices. The organization of these
memory types so as to minimize the access time is known as memory hierarchy. The computer
storage is separated into a hierarchy based on the response time.
What is Memory Hierarchy?
▪ The memory hierarchy is the arrangement of various types of storage on a computing
system based on access speed. It organizes computer storage according to response time.
Since response time, complexity, and capacity are all connected, the levels can also be
distinguished by their performance and controlling technologies.
▪ Memory Hierarchy helps in optimizing the memory available in the computer. There are
multiple levels present in the memory, each one having a different size, different cost, etc.
▪ Some types of memory like cache, and main memory are faster as compared to other types
of memory but they are having a little less size and are also costly whereas some memory
has a little higher storage value, but they are a little slower.
▪ Accessing of data is not similar in all types of memory, some have faster access whereas
some have slower access.
▪ As shown in the above picture, the computer memory has a pyramid-like structure. It is
used to describe the different levels of memory. It separates the computer storage based on
hierarchy.
As you can see, capacity is increasing with time. This Memory Hierarchy Design is divided into
2 types:
• Primary / internal memory: It consists of CPU registers, Cache Memory, Main Memory,
and these are directly accessible by the processor.
• Secondary / external memory : It consists of a Magnetic Disk, Optical Disk, Magnetic
Tape, which are accessible by processor via I/O Module.
Memory Hierarchy Design
• The main types of memory hierarchy include cache memory, main memory (RAM),
secondary storage (hard disks), and tertiary storage (optical disks or magnetic tapes).
1. Cache Memory
• It is the fastest type of memory and is located closest to the CPU. It stores frequently
accessed data and instructions, making it faster to retrieve them than from the main
memory. There are typically two or three levels of cache memory, with each level having
a larger capacity and slower access speed than the previous level.
2. Main Memory
• It is the primary memory of a computer system. It is slower than cache memory but faster
than secondary storage. The data and instructions stored in the main memory can be
accessed directly by the CPU.
3. Secondary Storage
• Secondary storage such as hard disks, is used for long-term storage of large amounts of
data that cannot fit in the main memory. It is slower than the main memory but has a much
larger capacity and is persistent (i.e., retains data even when the power is turned off).
4. Registers
• Registers are the fastest and smallest type of memory, located directly within the central
processing unit (CPU). They store small amounts of data that are frequently accessed by
the CPU. They also hold data, instructions, and control information that the CPU needs to
perform operations. The storage capacity for registers ranges from 16 to 64 bits.
5. Magnetic Disks
• Magnetic disks, like HDDs, store data magnetically on spinning platters. They offer high
storage capacity and support both sequential and random access. However, they are less
durable and slower than solid-state drives (SSDs). Still used for bulk data storage in some
systems, they provide cost-effective storage options for various applications.
6. Magnetic Tape
• Magnetic Tape is a sequential data storage medium consisting of a long plastic ribbon
coated with a magnetic material. It's known for its high-capacity, low cost per gigabyte,
and longevity. Magnetic tape is used primarily for archival purposes and data backup.
Accessing data on tape is slower compared to disk drives but well-suited for infrequently
accessed data.
Characteristics of Memory Hierarchy
The memory characteristics mainly include:
• Access Time: The interval between data availability and a read or write request.
• Capacity: The amount of information that can be stored increasing as we move from top
to bottom in the hierarchy.
• Performance: Historically, designing a computer system without a memory hierarchy
resulted in a significant speed gap between main memory and CPU registers, leading to
lower system performance. The memory hierarchy model was introduced to address this
issue and improve system performance.
• Cost Per Bit: Moving from bottom to top in the system's hierarchy, the cost per bit
increases, meaning that internal memory is costlier than external memory.
Advantages of Memory Hierarchy
• Faster access: Due to multiple levels in the memory hierarchy, users get faster access to
frequently used data. Cache memory, the fastest memory, stores the most frequently used
data.
• Cost-effective: Using the most expensive memory only where it is needed can help us
reduce the cost. Cache memory is more expensive than main memory or secondary storage.
With the help of memory hierarchy, it can be used only in necessary areas rather than using
it everywhere.
• Efficient use of resources: Computer resources can be used effectively by memory
hierarchy, ensuring no waste of resources. For example, high-speed access to a particular
data set that is not frequently used results in a waste of resources.
• Increased capacity: A system can store large data in secondary storage devices such as
Hard drives and SSD (solid-state drives) through memory hierarchy. On the other hand, the
most frequently used data is stored inside the cache.
• Increased processing speed: By memory hierarchy, operations can be performed much
faster as the fastest memory can be used for the most frequently used data. The CPU can
access the data in a faster manner, which in turn, increases the processing speed.
Disadvantages of Memory Hierarchy
• High Cost: Faster memory components like registers and cache are expensive. The overall
system cost increases due to the implementation of multiple memory levels.
• Complex Design: Managing different memory levels requires sophisticated algorithms,
making the system design more complex. Techniques like cache replacement policies add
to this complexity.
• Latency Issues: When the required data is not found in the cache (cache miss), fetching it
from lower memory levels (RAM or hard disk) increases access time, slowing down
performance.
• Higher Power Consumption: Maintaining multiple memory levels consumes more
power, especially in high-performance systems where cache and RAM are constantly
active.
• Data Inconsistency (Cache Coherence Problem): In multi-core processors, different
caches may store different versions of the same data. Synchronizing these caches to
maintain consistency requires additional processing power.
Semiconductor Memory
Semiconductor memory is the invisible foundation of our digital world and can be found in
everything from smartphones and computers to complex systems. Its steady development
guarantees significantly quicker, denser, and more effective methods for putting away and
controlling the data that characterizes our lives.
What is Semiconductor Memory?
A type of electronic memory known as semiconductor memory stores digital data by making
use of semiconductor materials, most commonly silicon. Data is stored in binary format in this
memory, with "1s" and "0s" representing electrical charges.
Semiconductor memory is a sort of computerized electronic memory that utilizes
semiconductor material, ordinarily silicon, to store and recover advanced information. It is the
essential sort of memory utilized in PCs, cell phones, and other electronic gadgets.
Types of Semiconductor Memory
There are two types of semi conductor memory
• Random Access Memory(RAM)
• Read-Only Memory(ROM)
Random Access Memory(RAM)
It permits information to be gotten to in any request,
making it appropriate for brief capacity.
• Type: Unpredictable - information evaporates
without power.
• Function: stores data for active applications on
a temporary basis.
• Speed: lightning-fast access in a flash.
• Capacity: Normally more modest than ROM.
• Applications: Running projects, open documents, program tabs.
Read Only Memory(ROM)
Information is for all time put away and can't be
changed during typical activity. It is utilized for
putting away firmware and other basic information.
• Type: Non-unstable - information perseveres
even without power.
• Function: provides permanent storage for
essential functions.
• Speed: More slow than Smash, as information recovery isn't as incessant.
• Capacity: Variable based on device complexity.
• Applications: Firmware, the operating system, and device drivers.
Working of Semiconductor Memory
RAM is majorly categorised into two categories:
o SRAM (Static Random Access Memory)
o 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 consist 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 Random Access Memory holds information as long as the power supply is
on. 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 as compared to SRAM and
operates at a slower rate than as well.
Dynamic Random Access Memory is installed for most system
memory as it is relatively cheap and small. It consists of memory cells, which constitute a single capacitor and a single
transistor.
Compare and contrast the performance of DRAM and SRAM.
Solution:
Feature DRAM SRAM
Speed Slower Faster
SRAM DRAM
It stores information as long as the power It stores information as long as the power is supplied or a few milliseconds
is supplied. when the power is switched off.
Transistors are used to store information
Capacitors are used to store data in DRAM.
in SRAM.
Capacitors are not used hence no To store information for a longer time, the contents of the capacitor need to
refreshing is required. be refreshed periodically.
SRAM is faster compared to DRAM. DRAM provides slow access speeds.
It does not have a refreshing unit. It has a refreshing unit.
These are expensive. These are cheaper.
SRAMs are low-density devices. DRAMs are high-density devices.
In this bit are stored in voltage form. In this bit is stored in the form of electric energy.
These are used in cache memories. These are used in main memories.
Consumes less power and generates less
Uses more power and generates more heat.
heat.
SRAMs has lower latency DRAM has more latency than SRAM
SRAMs are more resistant to radiation
DRAMs are less resistant to radiation than SRAMs
than DRAM
SRAM has higher data transfer rate DRAM has lower data transfer rate
SRAM DRAM
SRAM is used in high-speed cache
DRAM is used in lower-speed main memory
memory
SRAM is used in high performance
DRAM is used in general purpose applications
applications
Read Only Memory (ROM)
What is ROM?
ROM is a non-volatile memory that stores data permanently. Advanced ROM data can be erased and rewritten. The
information in ROM can only be accessed, making it perfect for use in computers as it enables quick access to data without
the need for constant data rewriting. Important data, like BIOS settings and operating system instructions, are stored in these
memories, which are crucial for the proper functioning of your computer. Without them, your computer would essentially
be "brain dead," so they must continue to work properly at all times!
Types of Read-Only Memory (ROM)
Based on its characteristics and uses, ROM is broadly classified into four different types −
1. MROM (Masked Read-Only Memory)
MROM stands for Masked Read-Only Memory. This memory device is no longer used nowadays due to obsolescence.
Manufacturers are using this memory to store software and information during the manufacturing process. Therefore, it is
impossible to alter, reprogram, or erase this type of pre-programmed chip later.
Applications of MROM
It is most widely used in Network Operating Systems and Server Operating Systems.
2. PROM (Programmable Read-Only Memory)
PROM stands for Programmable Read-Only Memory. Generally, its a blank memory chip. It can be programmed during
manufacturing and cannot be changed or erased. A PROM programmer or PROM burner is used to write information to a
PROM. The process of programming a PROM chip is commonly known as "PROM Burning." Once programmed, the chip's
content cannot be changed. As a result, it is also known as a one-time programmable device.
Applications of PROM
It is most widely used in Computer Bios, TV Remote, Video game consoles and nowadays a day used in Mobile Phones.
3. EPROM (Erasable Programmable Read-Only Memory)
EPROM stands for Erasable Programmable Read-Only Memory. It can be programmed and later erased by exposing it to
strong ultraviolet light. After being erased, the EPROM can be reprogrammed. EPROM is a type of read-only memory chip
that may erase previously programmed data. High voltage can be used to program the programmable read-only memory to
write data, which is then retained until exposed to ultraviolet light for 10 minutes or more.
Applications of EPROM
It is most widely used in Video cards, Memory sticks, BIOS chips, and Modem.
4. EEPROM (Electrically Erasable Programmable Read-Only Memory)
EEPROM stands for Electrically Erasable Programmable Read-Only Memory. It is an advanced type of ROM that can be
erased and reprogrammed electrically. This operation can be repeated indefinitely, and the computer system can do it while
running. The EEPROM allows users to program and erase any desired spot. It is erased byte by byte rather than the full
chip. As a result, reprogramming is flexible and takes less time to complete the process.
Applications of EEPROM
It is most widely used in Bios Chip and Microcontrollers for Smart Cards.
5. Flash Memory
It is a type of EEPROM that can be erased and reprogrammed in blocks rather than one byte at a time which allows for
faster and more efficient operations. It is widely employed as storage in modern devices such as USB drives, memory cards,
and SSDs. A modern variant of EEPROM is flash memory. With its newer designs and high endurance, it may be erased
and rewritten faster than typical EEPROMs.
Applications of Flash Memory
It is most widely used in storage devices like USB drives, memory cards, and SSDs.
Difference Between PROM and EPROM and EEPROM
PROM EPROM EEPROM
A Read-Only Memory (ROM) that A programmable ROM that can be A user-modifiable ROM that can be
can be modified only crushed and reused erased and
once by users reprogrammed repeatedly through a
normal electrical voltage
Stands for Programmable Read- Stands for Erasable Stands for Electrically
Only Memory Programmable Read-Only
Erasable Programmable Read-Only
Memory
Memory
Developed by Wen Tsing Chow in Developed by Dov Frohman in Developed by George
1956 1971
Perlegos in 1978
Reprogrammable Can be reprogrammed using Can be reprogrammed using
ultraviolet light electrical charge
only once
Difference Between RAM and ROM
RAM ROM
It stands for Random Access Memory It stands for Read-only Memory
It is more expensive than ROM It is less expensive than RAM
Its speed is high Its speed is low
Temporary storage for data and programs Permanent storage for data and programs
Its storage capacity is high compared to ROM Its storage capacity is low compared to the RAM
It can perform Read, Modify and Delete operations It performs only Read operations
It performs processing on current instructions It performs Bootstrap processing
RAM is a fast ROM is slow
Probably used in the CPU cache and primary memory Probably used in firmware and micro-controllers
It is volatile It is not volatile
Print Page