Memory, Buses & Microprocessor
Units of memory
A computer stores everything as bits. A bit (binary digit) is the smallest unit and is either 0 or 1. Eight bits make one byte, which is enough to store one English character such as A. Four bits are called a nibble.
| Unit | Equal to | Real-life size |
|---|---|---|
| 1 Byte (B) | 8 bits | One character |
| 1 Kilobyte (KB) | 1024 B | A short text file |
| 1 Megabyte (MB) | 1024 KB | A phone photo ≈ 3 MB |
| 1 Gigabyte (GB) | 1024 MB | A 1-hour HD movie ≈ 1.5 GB |
| 1 Terabyte (TB) | 1024 GB | A laptop hard disk |
| 1 Petabyte (PB) | 1024 TB | Data centres of big companies |
After PB come Exabyte (EB), Zettabyte (ZB) and Yottabyte (YB), each 1024 times the previous one.
A pen drive is 16 GB. How many MB is it? 16 × 1024 = 16384 MB. How many photos of 4 MB fit? 16384 ÷ 4 = 4096 photos.
Memory hierarchy
No single memory is fast, big and cheap at the same time. So a computer uses a hierarchy: small and very fast memory close to the CPU, large and slower memory further away.
Primary memory: RAM and ROM
Primary memory is directly accessed by the CPU. Programs must be loaded into it before they can run.
RAM – Random Access Memory
- Read and write
- Volatile: data lost when power is off
- Holds the OS, open apps and files right now
- Bigger RAM = more apps open smoothly (e.g. 8 GB)
ROM – Read Only Memory
- Mostly read only (written at the factory)
- Non-volatile: keeps data without power
- Holds the firmware / BIOS that starts the computer
- Small in size
Types: SRAM (fast, used for cache) and DRAM (cheaper, used as main memory). ROM types are PROM (write once), EPROM (erase with UV light) and EEPROM (erase electrically; flash memory in pen drives is a type of EEPROM).
Cache memory
RAM is much slower than the CPU, so the CPU would waste time waiting. Cache is a small, very fast memory that keeps a copy of the data and instructions the CPU is likely to need next. If the data is found in cache it is a cache hit; otherwise it is a miss and data is fetched from RAM.
Example: in a loop that adds 1000 marks, the same few instructions run again and again. After the first time they stay in cache, so the loop runs much faster.
Secondary storage
Secondary memory (storage) is non-volatile and much bigger, but the CPU cannot use it directly; data is first copied into RAM.
| Device | How it stores | Typical use |
|---|---|---|
| Hard Disk Drive (HDD) | Magnetic spinning platters | Cheap large storage, 1–4 TB |
| Solid State Drive (SSD) | Flash chips, no moving parts | Fast laptops; boots in seconds |
| Pen drive / memory card | Flash memory | Carry files, phone storage |
| CD / DVD / Blu-ray | Optical (laser) | Old software, movies |
| Cloud storage | Remote servers via internet | Google Drive, backups |
Data transfer between memory and CPU: the system bus
Parts of a computer are connected by sets of wires called buses. The system bus has three parts:
| Bus | Carries | Direction |
|---|---|---|
| Data bus | Actual data / instructions | Two-way (bidirectional) |
| Address bus | Memory location number | One-way: CPU → memory |
| Control bus | Signals like READ, WRITE, clock | Both ways |
An address bus of n wires can point to 2ⁿ different locations. With 16 lines: 2¹⁶ = 65536 locations (64 KB). With 32 lines: 2³² ≈ 4 GB. That is why old 32-bit computers could not use more than about 4 GB of RAM.
Microprocessor
A microprocessor is a complete CPU on a single integrated-circuit chip. Intel 4004 (1971) was the first; today's chips like Intel Core, AMD Ryzen, Apple M-series and Qualcomm Snapdragon hold billions of transistors.
Multi-core: one chip has 2, 4, 8 or more cores; each core is a separate processor, so many tasks run in parallel. Microcontroller: a small chip that has a CPU, memory and I/O together, used in washing machines, remote controls and Arduino boards.
Reading a processor specification
| Term | Meaning | Example |
|---|---|---|
| Word size | Bits the CPU processes at once | 64-bit |
| Clock speed | Instruction cycles per second | 3.2 GHz = 3.2 billion cycles/second |
| Cores | Independent processors on the chip | 8 cores |
| Cache size | Fast memory on the chip | 16 MB L3 cache |
| Power | Heat / battery use | 15 W for thin laptops |
Summary & practice
- bit → nibble (4) → byte (8 bits) → KB → MB → GB → TB → PB (×1024 each).
- Registers > cache > RAM > SSD/HDD in speed; the reverse in size.
- RAM is volatile; ROM is non-volatile and stores startup firmware.
- Buses: data (two-way), address (one-way), control.
- Microprocessor = CPU on a chip; multi-core chips run tasks in parallel.
1) Convert 2 GB into KB. 2) A CPU has 20 address lines. How many memory locations can it address? 3) Why do we need cache when RAM is already there?
Answers: 1) 2 × 1024 × 1024 = 2097152 KB. 2) 2²⁰ = 1048576 (1 M) locations. 3) Cache is much faster than RAM, so the CPU waits less.
