🗄️ Hardware & Software

Memory & Storage

मेमोरी और स्टोरेज

⏱ 2 hr3 topicsInteractive
🎯 By the end: You can explain the memory hierarchy, distinguish RAM from ROM and SRAM from DRAM, compare HDD and SSD, and order the units from bit to yottabyte.

Why does a computer have so many kinds of memory — registers, cache, RAM, SSD, hard disk? Because there's an unavoidable trade-off: memory that's lightning-fast is tiny and expensive, while memory that's huge and cheap is slow. Computers solve this with a clever arrangement called the memory hierarchy.

1The memory pyramid

Arrange memory as a pyramid. As you go up, memory gets faster, smaller and costlier per byte. As you go down, it gets slower, larger and cheaper.

RegistersCache (L1/L2/L3)RAM (main memory)SSD (solid-state drive)Hard Disk / Optical (secondary)fast,small,costlyslow, big, cheap

The big divide is between primary memory (registers, cache, RAM — directly reachable by the CPU, mostly volatile) and secondary storage (SSD, HDD, optical — permanent, holds your files when the power is off).

Key points
  • Memory hierarchy: faster + smaller + costlier at the top (registers), slower + larger + cheaper at the bottom (hard disk).
  • Primary memory (registers, cache, RAM) is fast and directly used by the CPU.
  • Secondary storage (SSD, HDD, optical) is permanent and holds files when power is off.

2RAM, ROM and cache

The two main types of primary memory are RAM and ROM — and the difference is a classic exam question.

RAMROM
Stands forRandom Access MemoryRead Only Memory
Volatile?Yes — loses contents when power is offNo — keeps contents without power
Read/WriteRead and writeMainly read
HoldsPrograms & data currently in useStart-up instructions (e.g. BIOS)
  • RAM types: SRAM (Static — faster, used for cache) and DRAM (Dynamic — slower, cheaper, used as main memory; needs constant refreshing).
  • ROM types: PROM (programmed once), EPROM (erasable with UV light), EEPROM (erasable electrically).
  • Cache is a small, very fast memory between the CPU and RAM (levels L1, L2, L3) that keeps frequently used data close to the CPU to avoid waiting for slower RAM.
Key points
  • RAM is volatile (lost on power-off), read/write, holds programs in use; ROM is non-volatile and mainly read (e.g. BIOS).
  • SRAM (fast, used for cache) vs DRAM (slower, cheaper, main memory); ROM types: PROM, EPROM, EEPROM.
  • Cache (L1/L2/L3) sits between CPU and RAM, holding frequently used data to speed things up.

3Secondary storage and units of measurement

Secondary storage keeps your data permanently:

  • HDD (Hard Disk Drive): magnetic, spinning platters. Cheap and high-capacity, but slower and fragile (moving parts).
  • SSD (Solid-State Drive): flash memory, no moving parts. Much faster and sturdier, but costlier per GB.
  • Optical: CD, DVD, Blu-ray — data read by a laser.

Units of measurement

Data size is built up from the bit (a single 0 or 1). Eight bits make one byte. From there, each step is about 1000 times bigger:

UnitSize
1 Byte8 bits
Kilobyte (KB)about 1,000 bytes
Megabyte (MB)about 1,000 KB
Gigabyte (GB)about 1,000 MB
Terabyte (TB)about 1,000 GB

The full ladder continues: Bit → Byte → KB → MB → GB → TB → PB → EB → ZB → YB (Petabyte, Exabyte, Zettabyte, Yottabyte).

Strictly, 1 KB = 1024 bytes (2¹⁰), because computers count in binary. The round '1000' is an everyday approximation; exams may ask for either, so know both.
Key points
  • HDD = magnetic, cheap, high-capacity, slower (moving parts); SSD = flash, faster, sturdier, costlier.
  • 8 bits = 1 byte; the ladder is Bit→Byte→KB→MB→GB→TB→PB→EB→ZB→YB.
  • 1 KB = 1024 bytes exactly (2¹⁰); ~1000 is the everyday approximation.

★ Practical: sort and size

On paper:

  1. Place these in order from fastest to slowest: RAM, registers, hard disk, cache.
  2. State one difference between RAM and ROM, and one between SRAM and DRAM.
  3. List the units in order from smallest to largest: GB, KB, TB, MB, Byte.
  4. Give one advantage of an SSD over an HDD, and one advantage of an HDD over an SSD.

Ready for the chapter test?

Answer 5 questions. Score 60% or more to mark this chapter complete.

Start the test →

💡 Log in to save your progress and earn the certificate.