The Processor and the Fetch-Decode-Execute Cycle: Quick Revision
A brief note on the processor: the units, the five registers and the three buses, the fetch-decode-execute cycle, cores, cache and the clock, the instruction set and embedded systems, with the usual slips and questions to check yourself.
A brief note on The Processor and the Fetch-Decode-Execute Cycle. Read it before a test. Try each question at the end before you open its answer.
The CPU
Role. The CPU processes instructions and data that are input, so that the result can be output.
Microprocessor. A type of integrated circuit on a single chip.
Von Neumann architecture. Instructions and data are stored together in the same memory.
Units, registers and buses
ALU: calculations and logic, such as comparing.
CU: decodes instructions and sends control signals.
PC: the address of the next instruction.
MAR: the address being read from or written to.
MDR: the data or instruction read from memory, or to be written.
CIR: the instruction being decoded and executed.
ACC: the result of a calculation by the ALU.
Address bus: addresses, from the CPU to memory only.
Data bus: data and instructions, both ways.
Control bus: signals such as read, write and the clock, both ways.
The fetch-decode-execute cycle
Fetch. PC to MAR. The address goes on the address bus. The instruction comes on the data bus to the MDR, then to the CIR. The PC goes up by 1.
Decode. The CU decodes the instruction in the CIR.
Execute. The instruction is carried out. Any data goes through the MAR and the MDR, the ALU calculates, and the result goes to the ACC.
Performance
Clock speed: cycles each second, in hertz. Faster clock, more instructions each second.
Cores: more instructions at the same time, but not always a proportional gain, because some steps must run in order.
Cache: small, fast memory near the CPU. Larger cache, fewer slow fetches from RAM.
Instruction sets and embedded systems
Instruction set: the list of all the commands a CPU can process. The commands are machine code.
Embedded system: performs a dedicated function in a larger device, such as a domestic appliance, a car, a security system, a lighting system or a vending machine.
General purpose computer: a PC or laptop, used for many different functions.
Practice with new numbers
A program to try
The program runs a three-instruction program and prints the PC and the ACC after each cycle.
Mistakes to avoid
MAR or MDR. The MAR holds an address. The MDR holds the data.
When the PC changes. It goes up in the fetch stage.
Who decodes. The control unit, not the ALU.
Cores. Doubling the cores does not always halve the time.
Check yourself
Which register holds the instruction that is being decoded?
Name the bus that carries a read signal.
The PC holds 73 at the start of a fetch. What is in the MAR straight after the first step?
Give one reason why a larger cache can improve performance.
Give two examples of devices that contain an embedded system.