The fetch-decode-execute cycle
Follow one instruction through the PC, MAR, MDR, CIR and ACC registers, then run a small program.
Transcript
A CPU only understands its own instruction set, written in machine code. Each instruction has an opcode, what to do, and an operand, what to do it to.
The CPU repeats one cycle, billions of times a second: fetch, decode, execute.
Fetch. The address in the program counter is copied to the M A R. The contents of that memory cell go to the M D R, and the program counter goes up by one. Then the instruction is copied to the C I R.
Decode. The control unit works out what the instruction in the C I R means.
Execute. The instruction is carried out. Here, the number at address six is loaded into the accumulator.
Then the cycle starts again. Add the number at address seven, and store the answer, forty two, at address eight.
Fetch, decode, execute. Over and over, that is all a CPU ever does.
More in this series
1:21Inside the CPU
The control unit, ALU and registers, the Von Neumann architecture and the three buses.
1:28What makes a CPU faster?
Clock speed, number of cores and cache size, with the run times worked out.
1:00Embedded systems
A computer built into a device for one job: examples, and how it differs from a general-purpose computer.
1:45Input devices
Keyboards, mice, touch screens, microphones, cameras, scanners and barcode / QR readers.
1:41Output devices
Screens, projectors, printers, 3D printers and speakers: what each one does.
1:06Sensors and actuators
A control loop: a sensor measures, the processor decides, an actuator acts. A thermostat shown step by step.
1:29Primary storage: RAM, ROM and virtual memory
Volatile RAM, non-volatile ROM with the boot program, and what virtual memory does when RAM is full.
1:30Secondary storage
Magnetic, optical and solid-state storage, plus cloud storage.
1:34Network hardware: NIC, MAC, IP and routers
What a network interface card, MAC address, IP address (IPv4 and IPv6) and router each do.
5:10Unit 3 quiz
Ten questions with a think-time countdown and explained answers.