Last reviewed 16 Sept 2026 · 9 min read
Memory hierarchy
Memory is organised by speed, cost and capacity:
Registers (fastest, smallest, costliest) → Cache memory → Main memory (RAM) → Secondary storage (SSD, HDD) → Tertiary/offline storage (tapes, optical discs, cloud) (slowest, largest, cheapest per GB)
- Moving down: capacity increases, speed decreases, cost per bit decreases.
Cache memory
- Very fast memory (SRAM) between CPU and RAM storing frequently used data/instructions — levels L1 (inside core, smallest, fastest), L2, L3 (shared).
- Improves performance using the locality of reference principle.
Primary memory
RAM (Random Access Memory)
- Volatile — contents lost when power is off.
- Read–write working memory holding the OS, running programs and data.
- More RAM allows more programs and larger files to be handled simultaneously.
| Type | Features |
|---|---|
| SRAM (Static RAM) | Uses flip-flops; faster, costlier, no refreshing — used as cache |
| DRAM (Dynamic RAM) | Uses capacitors; needs periodic refreshing; cheaper, denser — main memory |
| SDRAM, DDR (DDR3, DDR4, DDR5) | Synchronous DRAM generations — faster data transfer |
ROM (Read Only Memory)
- Non-volatile — retains contents without power.
- Stores firmware (BIOS/UEFI, boot instructions, embedded programs).
| Type | Features |
|---|---|
| Mask ROM | Programmed during manufacture |
| PROM (Programmable ROM) | Programmed once by user |
| EPROM (Erasable PROM) | Erased by ultraviolet light, reprogrammable |
| EEPROM (Electrically Erasable PROM) | Erased and reprogrammed electrically |
| Flash memory | Type of EEPROM erased in blocks — pen drives, SSDs, memory cards, firmware |
RAM vs ROM
| RAM | ROM |
|---|---|
| Volatile | Non-volatile |
| Read and write | Mainly read (writing limited/special) |
| Temporary storage of current work | Permanent storage of boot/firmware instructions |
| Larger capacity | Smaller capacity |
Secondary storage
Non-volatile, high capacity, slower than RAM.
| Category | Devices | Typical capacities / features |
|---|---|---|
| Magnetic | Hard disk drive (HDD) — platters, read/write heads, tracks and sectors | Hundreds of GB to many TB; cheaper per GB; mechanical |
| Magnetic tape | Sequential access; very large, cheap — backups and archives | |
| Floppy disk (obsolete) | 1.44 MB (3.5-inch) | |
| Optical (laser) | CD | About 700 MB |
| DVD | About 4.7 GB (single-layer), 8.5 GB dual-layer | |
| Blu-ray | About 25 GB per layer (blue-violet laser) | |
| Solid-state (flash) | SSD | No moving parts, much faster, lower power, shock resistant; costlier per GB |
| Pen drive (USB flash drive), memory cards (SD, microSD) | Portable | |
| Network/cloud storage | NAS, cloud (Google Drive, OneDrive) | Access from anywhere; depends on internet |
- Access methods: sequential (tape) vs direct/random (disks).
- Disk formatting creates tracks/sectors and file system; defragmentation reorganises fragmented files on HDDs (not needed for SSDs).
Virtual memory
- Technique where part of secondary storage (page file/swap space) is used as an extension of RAM, allowing programs larger than physical memory to run.
- Uses paging (fixed-size pages) or segmentation; excessive swapping slows the system (thrashing).
Operating systems
An operating system (OS) is system software that acts as an interface between the user and hardware, managing resources and providing services to application programs.
Functions of an operating system
| Function | Description |
|---|---|
| Process management | Creating, scheduling and terminating processes; multitasking; inter-process communication |
| Memory management | Allocating and freeing RAM; virtual memory |
| File management | Organising files and folders; access permissions |
| Device (I/O) management | Controlling peripherals through drivers; spooling (printing) |
| Security and access control | User accounts, passwords, permissions, firewall |
| User interface | CLI or GUI |
| Error detection and handling | System messages, logs |
| Resource accounting and networking | Tracking usage; network connections |
Types of operating systems
| Type | Features / examples |
|---|---|
| Batch OS | Similar jobs grouped and run without user interaction (early mainframes) |
| Multiprogramming | Several programs in memory; CPU switches when one waits for I/O |
| Time-sharing / multitasking | CPU time divided into slices among users/tasks — appears simultaneous (Unix) |
| Multiprocessing | Uses two or more CPUs/cores |
| Real-time OS (RTOS) | Guaranteed response within strict time limits — air traffic control, industrial control, medical devices, missile systems, embedded systems |
| Distributed OS | Manages multiple networked computers as one system |
| Network OS | Manages network resources, file/printer sharing (Windows Server) |
| Mobile OS | Android (Linux-based, Google), iOS (Apple) |
| Single-user / multi-user | MS-DOS (single-user, single-task); Unix/Linux (multi-user) |
Popular operating systems
| OS | Developer / notes |
|---|---|
| MS-DOS | Microsoft — command-line, single-user (1981) |
| Windows | Microsoft — GUI; versions include XP, 7, 10, 11 |
| macOS | Apple — Unix-based |
| Unix | Developed at Bell Labs (Ken Thompson, Dennis Ritchie) — multi-user, multitasking |
| Linux | Open-source kernel created by Linus Torvalds (1991); distributions — Ubuntu, Fedora, Red Hat, Debian; also BOSS Linux (India, C-DAC) |
| Android | Google — open-source, Linux-based mobile OS |
| iOS | Apple — iPhone |
| Chrome OS | Google — browser-centric |