Introduction
Computer memory stores data and instructions at different speeds, costs, and capacities — arranged in a
"memory hierarchy." This chapter also covers data measurement units and how computers represent
information internally using binary.
Memory Hierarchy
Flowchart — Memory Hierarchy (Fastest/Smallest to Slowest/Largest)
CPU Registers (fastest, smallest, most expensive)
↓
Cache Memory
↓
Primary Memory (RAM)
↓
Secondary Storage (HDD/SSD) — slowest, largest, cheapest per GB
RAM vs ROM
| Feature | RAM | ROM |
| Full Form | Random Access Memory | Read-Only Memory |
| Volatility | Volatile (data lost when power is off) | Non-volatile (data retained without power) |
| Function | Temporary working memory for active programs/data | Stores permanent, essential startup instructions (e.g., BIOS) |
| Read/Write | Both read and write | Primarily read-only (though some variants allow limited writing — EPROM, EEPROM) |
Types of RAM and ROM
| Type | Description |
| SRAM (Static RAM) | Faster, more expensive, used for cache memory |
| DRAM (Dynamic RAM) | Slower, cheaper, needs periodic refreshing; used as main system RAM |
| PROM | Programmable ROM — can be written once by the user |
| EPROM | Erasable PROM — can be erased using UV light and reprogrammed |
| EEPROM | Electrically Erasable PROM — can be erased/reprogrammed electrically (used in modern flash memory) |
Secondary Storage Devices
| Device | Note |
| HDD (Hard Disk Drive) | Magnetic storage, larger capacity, slower, cheaper per GB |
| SSD (Solid State Drive) | Flash-memory based, much faster, more expensive per GB, no moving parts |
| Optical Disks | CD, DVD, Blu-ray — use laser technology to read/write data |
| Flash Drives (Pen Drives) | Portable USB-based flash memory storage |
Data Measurement Units
| Unit | Equivalent |
| Bit | Smallest unit — a single 0 or 1 |
| Byte | 8 bits |
| Kilobyte (KB) | 1024 Bytes |
| Megabyte (MB) | 1024 KB |
| Gigabyte (GB) | 1024 MB |
| Terabyte (TB) | 1024 GB |
| Petabyte (PB) | 1024 TB |
⚠️ Common Trap: Data units use base 1024 (2¹⁰), not 1000 — a common exam trap tests whether you know 1 KB = 1024 Bytes, not 1000 Bytes.
Number Systems Used in Computing
| System | Base | Digits Used |
| Binary | 2 | 0, 1 |
| Octal | 8 | 0-7 |
| Decimal | 10 | 0-9 |
| Hexadecimal | 16 | 0-9, A-F |
📌 Why Binary: Computers use the binary system because electronic circuits have two natural states — ON (1) and OFF (0) — making binary the most reliable way to represent and process data at the hardware level.
✅ UPSC/SSC Focus: Memory hierarchy order (registers → cache → RAM → secondary storage) · RAM vs ROM (volatile vs non-volatile) · PROM/EPROM/EEPROM distinctions · Data unit conversions (base 1024) · Why computers use binary.