Lesson 2 of 10 · Computer Knowledge

CPU and Memory: ALU, Control Unit, RAM, ROM, Cache and Memory Units

Drafted with AI assistance and fact-checked on 28 October 2026; not yet read line by line by a human editor. Spotted a mistake? Tell us. Editorial standards & corrections

The processor

The Central Processing Unit (CPU) is called the brain of the computer because it carries out every instruction of a program. In a modern computer the whole CPU sits on one chip, the microprocessor, mounted on the motherboard, the main circuit board that links the CPU, memory and other parts through buses: the data bus carries data, the address bus carries memory addresses and the control bus carries control signals. The CPU has three parts: the Arithmetic Logic Unit, the Control Unit and the registers.

ALU, control unit and registers

The Arithmetic Logic Unit (ALU) does arithmetic (addition, subtraction, multiplication, division) and logical operations (comparisons such as greater than or equal to, and AND, OR, NOT). The Control Unit (CU) does not process data itself; like a traffic controller, it fetches instructions from memory, decodes them and directs the ALU, memory and input-output devices. Registers are tiny, very fast storage locations inside the CPU. The Program Counter holds the address of the next instruction, the Instruction Register holds the instruction being executed, the Memory Address Register holds the address to be read or written, the Memory Data Register holds the data moving to or from memory, and the Accumulator holds the intermediate results of the ALU.

The machine cycle

For every instruction the CPU repeats a machine (instruction) cycle of four steps: fetch the instruction from memory, decode it, execute it and store the result. Fetch and decode make up the instruction time (I-time); execute and store make up the execution time (E-time). A clock inside the CPU sends regular pulses that keep these steps in time. Clock speed is measured in hertz, and a 3 GHz processor runs 3 billion clock cycles per second. Processing speed is also expressed in MIPS (million instructions per second). A multi-core processor (dual-core, quad-core) has two or more processing units on one chip, and word size (32-bit or 64-bit) is the number of bits the CPU handles at a time.

Primary memory and RAM

Primary or main memory holds the programs and data the CPU is using right now. RAM (Random Access Memory) can be both read and written, and any location can be reached directly; it is volatile, so its contents are lost when the power goes off. Static RAM (SRAM) stores each bit in a flip-flop circuit, needs no refreshing, is fast and costly, and is used for cache. Dynamic RAM (DRAM) stores each bit as a charge on a tiny capacitor that leaks, so it must be refreshed many times every second; it is cheaper and packs more data, so it is used as main memory. SDRAM and DDR (double data rate) memory are forms of DRAM.

ROM and its types

ROM (Read Only Memory) is non-volatile and holds firmware such as the BIOS (Basic Input/Output System) that starts the computer. Mask ROM is written at the factory. PROM (Programmable ROM) can be written once by the user. EPROM (Erasable PROM) is erased with ultraviolet light and then rewritten, while EEPROM (Electrically Erasable PROM) is erased with electrical signals. Flash memory, used in pen drives, memory cards and SSDs, is a type of EEPROM.

Cache and virtual memory

Cache is a small, very fast SRAM memory placed between the CPU and RAM that keeps the most frequently used data and instructions close at hand; L1 cache is the smallest and fastest, followed by L2 and L3. Virtual memory works the other way: when RAM is full, the operating system uses part of the hard disk (the page file or swap space) as if it were RAM, moving blocks of data called pages between the two. It lets bigger programs run but is much slower than real RAM. The memory hierarchy, from fastest and costliest to slowest and cheapest, is registers, cache, RAM and secondary storage.

Memory units

The bit (binary digit, 0 or 1) is the smallest unit. 4 bits make a nibble and 8 bits a byte, enough for one character. After that each unit is 1024 times the one before: 1 kilobyte (KB) = 1024 bytes, 1 megabyte (MB) = 1024 KB, 1 gigabyte (GB) = 1024 MB, 1 terabyte (TB) = 1024 GB and 1 petabyte (PB) = 1024 TB, followed by the exabyte, zettabyte and yottabyte. Since 1024 is 2 to the power 10, 1 KB = 8192 bits, 1 MB = 1,048,576 bytes and 1 GB = 1,073,741,824 bytes. To convert to a smaller unit multiply by 1024, and to a larger one divide: 4 GB = 4096 MB, and 2048 KB = 2 MB. Disk makers count 1 GB as 1000 million bytes, which is why a drive shows a little less space than its label.

Key facts

  • ALU performs arithmetic and logical operations; the Control Unit fetches, decodes and directs but does not process data; registers are the fastest storage inside the CPU.
  • The Program Counter holds the address of the next instruction; the Accumulator holds intermediate ALU results.
  • Machine cycle: fetch, decode, execute, store; fetch plus decode is I-time, execute plus store is E-time.
  • Clock speed is measured in hertz (GHz today); processor speed is also given in MIPS and supercomputer speed in FLOPS.
  • SRAM (flip-flops, no refresh, fast, used for cache) versus DRAM (capacitors, needs refresh, cheaper, used as main memory).
  • ROM types: PROM written once; EPROM erased by ultraviolet light; EEPROM erased electrically; flash memory is a kind of EEPROM.
  • Cache sits between the CPU and RAM (L1 is fastest); virtual memory uses hard disk space as an extension of RAM.
  • Memory hierarchy, fastest to slowest: registers, cache, RAM, secondary storage (hard disk, optical disc).
  • 4 bits = 1 nibble; 8 bits = 1 byte; 1024 bytes = 1 KB; 1024 KB = 1 MB; 1024 MB = 1 GB; 1024 GB = 1 TB; 1024 TB = 1 PB.
  • Order of units: bit, nibble, byte, KB, MB, GB, TB, PB, EB, ZB, YB; 1 GB = 2 to the power 30 bytes = 1,073,741,824 bytes.

Quick revision

CPU = ALU + Control Unit + registers (Program Counter, Accumulator); machine cycle fetch-decode-execute-store; clock speed in Hz, speed also in MIPS; RAM volatile (SRAM for cache, DRAM for main memory); ROM non-volatile (PROM, EPROM by UV, EEPROM, flash), holds BIOS; cache L1 fastest; virtual memory uses disk; 1 nibble = 4 bits, 1 byte = 8 bits; KB, MB, GB, TB, PB each 1024 times the last.

Practise this topic

All 10 lessons on Computer Knowledge