Skip to content
BetterDL

Central processing unit (CPU)

Also called: processor, microprocessor

The part of a computer that fetches instructions from memory and carries them out, built from a datapath and a control unit.

The CPU is the part of a computer that runs programs. It repeatedly fetches an instruction from memory, works out what it means, and carries it out: the fetch decode execute cycle.

Nothing inside a CPU is new by the end of this course. It's built from parts you already know:

  • Registers hold values between clock edges;
  • an ALU adds, subtracts and does logic;
  • Multiplexers choose which value goes where;
  • a connection to memory reads and writes words;
  • a finite state machine steps through each instruction, one state per clock cycle.

Those parts split into two halves: the datapath, which holds and transforms data, and the control unit, which tells the datapath what to do in each cycle.

A microprocessor is a whole CPU on one chip. Lab CPUs built in a simulator or on an FPGA, like the course's Tiny8, look much like a tiny version of a real one: a few registers, one memory, a small ALU and a control FSM.

Worked example

Example

Sorting Tiny8's parts

Which half of Tiny8 does each part belong to: the ALU, the MAR, the step counter that goes F1, F2, F3, D, E1, E2, the opcode decoder, and the ACC's mux?

  1. 1.

    Datapath: the ALU, the MAR and the ACC's mux. They hold, transform or route data.

  2. 2.

    Control unit: the step FSM and the opcode decoder. They decide what happens each cycle.

  3. 3.

    The control unit's outputs, the control signals, are the wires that join the two halves.

Common mistakes

  • Thinking a CPU contains some special new kind of circuit. It's registers, an ALU, muxes and an FSM.

  • Counting main memory as part of the CPU. The CPU connects to memory through the MAR and MDR.

Practice Central processing unit (CPU)

Interactive questions with instant feedback and a worked solution for every wrong answer.

Basic CPU / Computer Architecture lesson full course

Learn it step by step

Central processing unit (CPU) is taught in Basic CPU / Computer Architecture.