Computer Memory Hierarchy
The Computer memory hierarchy looks like a pyramid structure
which is used to describe the differences among memory types. It separates the
computer storage based on hierarchy.
Level 0: CPU registers
Level 1: Cache memory
Level 2: Main memory or primary memory
Level 3: Magnetic disks or secondary memory
Level 4: Optical disks or magnetic types or tertiary Memory
In Memory Hierarchy the cost of memory, capacity is inversely
proportional to speed. Here the devices are arranged in a manner Fast to slow,
that is form register to Tertiary memory.
Let us discuss each level in detail:
Level-0 − Registers
The registers are present inside the CPU. As they are present
inside the CPU, they have least access time. Registers are most expensive and
smallest in size generally in kilobytes. They are implemented by using
Flip-Flops. These are the fastest and smallest units of memory, located within
the CPU (Central Processing Unit). Registers store data that the CPU is
actively using for calculations and operations.
Level-1 − Cache
Cache memory is used to store the segments of a program that
are frequently accessed by the processor. It is expensive and smaller in size
generally in Megabytes and is implemented by using static RAM. Cache memory is
a small but extremely fast memory located between the CPU and main memory
(RAM). It is used to store frequently accessed data and instructions to reduce
the time it takes for the CPU to access them.
Level-2 − Primary or Main Memory
It directly communicates with the CPU and with auxiliary
memory devices through an I/O processor. Main memory is less expensive than
cache memory and larger in size generally in Gigabytes. This memory is
implemented by using dynamic RAM.
RAM is the primary memory used for storing data and programs
that are currently being used by the computer. It is faster than secondary
storage devices like hard drives but is volatile, meaning it loses its data
when the computer is powered off.
ROM
Level-3 − Secondary storage
Secondary storage devices like Magnetic Disk are present at
level 3. They are used as backup storage. They are cheaper than main memory and
larger in size generally in a few TB.
Secondary storage includes devices like hard drives (HDDs)
and solid-state drives (SSDs). They offer much larger storage capacity than RAM
but are slower in terms of data access. Data stored here is non-volatile,
meaning it remains even when the computer is powered off.
Level-4 − Tertiary storage
Tertiary storage devices like magnetic tape are present at
level 4. They are used to store removable files and are the cheapest and
largest in size (1-20 TB).
Let us see the memory levels in terms of size, access time,
bandwidth.
Tertiary storage refers to long-term archival storage
solutions such as tape drives and optical discs. These provide even larger
storage capacities but are significantly slower for data access compared to
secondary storage.
Level | Register | Cache | Primary memory | Secondary memory |
Bandwidth | 4k to 32k MB/sec | 800 to 5k MB/sec | 400 to 2k MB/sec | 4 to 32 MB/sec |
Size | Less than 1KB | Less than 4MB | Less than 2 GB | Greater than 2 GB |
Access time | 2 to 5nsec | 3 to 10 nsec | 80 to 400 nsec | 5ms |
Managed by | Compiler | Hardware | Operating system | OS or user |
0 Comments