⬅ Back to Topics

Computer Memory

Comprehensive study notes for technical competitive exams.

1. What is Computer Memory?

Computer memory is a physical device used to store data, instructions, and results temporarily or permanently.
It allows the computer to process information quickly and efficiently.

imageWhy Memory is Required?

  • To store program instructions
  • To store input data
  • To store intermediate results
  • To store final output

imageWithout memory, a computer cannot function.

?? 2. Memory Organization & Hierarchy

Computer memory is organized in a hierarchical manner based on:

  • Speed
  • Cost
  • Storage capacity

image

Memory Hierarchy Order:

  1. Register Memory (Fastest, Costliest) image
  2. Cache Memory
  3. Primary Memory (RAM & ROM)
  4. Secondary Memory (Slowest, Cheapest)

?? Faster memory = Higher cost & lower capacity

?? 3. Types of Computer Memory

Computer memory is mainly divided into:

  1. Primary Memory
  2. Secondary Memory
  3. Cache Memory
  4. Register Memory

?? 4. Primary Memory (Main Memory)

imagePrimary memory is the memory that is directly accessed by the CPU.

Characteristics:

  • High speed
  • Limited storage
  • Expensive
  • Mostly volatile

Primary memory stores currently running programs and data.

?? 5. Types of Primary Memory

Primary memory is classified into:

  1. RAM (Random Access Memory)
  2. ROM (Read Only Memory)
  3. Cache Memory

?? 6. RAM (Random Access Memory) image

RAM is a volatile memory used to store data and programs that are currently in use.

Key Features:

  • imageData lost when power OFF
  • Fast read & write
  • Supports multitasking
  • Direct CPU access

 

How RAM Works:

  • Programs load from storage to RAM
  • CPU accesses RAM for execution
  • More RAM = Bettimageer performance

?? 7. Types of RAM

(a) SRAM – Static RAMimage

  • Very fast
  • No refresh required
  • Expensive
  • Used as cache memory

(b) DRAM – Dynamic RAM

  • Slower than SRAM
  • Needs frequent refresh
  • Cheap
  • Used as main memory

(c) VRAM – Video RAM

  • imageDedicated graphics memory
  • Used in GPUs
  • Stores textures & frames

image

 

?? 8. SRAM vs DRAM (Important Theory)

Feature

SRAM

DRAM

Speed

Very High

Moderate

Refresh

Not required

Required

Cost

Expensive

Cheap

Storage

Small

Large

Usage

Cache

Main Memory

?? 9. ROM (Read Only Memory) image

ROM is a non-volatile memory that stores permanent instructions needed to start a computer.

Key Features:

  • Data retained after power OFF
  • Mostly read-only
  • Used in booting

?? 10. Types of ROM

(a) PROM

  • imageProgrammed once
  • Cannot be changed

(b) EPROM

  • Erased using UV light
  • Reprogrammable

(c) EEPROM

  • Electrically erasable
  • Selective erase possible

(d) Flash ROM

  • Faster version of EEPROM
  • Used in USB, SSD, memory cards

image

 

 

 

 image

image

?? 11. Cache Memory

 

imageCache memory is a small, high-speed memory placed between CPU and RAM.

Purpose:

  • Reduce access time
  • Increase CPU speed
  • Store frequently used data

image

?? 12. Levels of Cache Memory

Cache memory is divided into three levels:

imageL1 Cache

  • Fastest
  • Smallest
  • Inside CPU core

L2 Cache

  • Slower than L1
  • Larger size

L3 Cache

  • Largest
  • Shared among cores

image

?? 13. Register Memory

Register memory is the fastest memory located inside the CPU.

Characteristics:

  • Very small
  • Extremely fast
  • Stores instructions & addresses

imageTypes of Registers:

  • Program Counter (PC)
  • Instruction Register (IR)
  • Memory Address Register (MAR)
  • Memory Data Register (MDR)

?? 14. Secondary Memory

Secondary memory stores data permanently and is not directly accessed by CPU.

Characteristics:

  • Non-volatile
  • Large capacity
  • Slow but cheap

?? 15. Types of Secondary Memory

Magnetic Storage:

  • Hard Disk Drive (HDD)
  • Magnetic Tape

Optical Storage:

  • CD
  • DVD
  • Blu-ray Disc

Flash Storage:

  • SSD
  • Pen Drive
  • Memory Cards

Cloud Storage:

  • Google Drive
  • OneDrive
  • Dropbox

image

image

?? 16. RAM vs ROM (Theory Comparison)

RAM

ROM

Volatile

Non-volatile

Temporary

Permanent

Faster

Slower

Used during execution

Used during boot

Read & Write

Read only

?? 17. Important Teaching Points

  • Cache improves system speed
  • RAM affects multitasking
  • ROM stores firmware
  • SSD is faster than HDD
  • Memory hierarchy balances cost & speed