Your canteen total is £7. You add a £4 lunch. How does the CPU get to £11?
Your school canteen till shows seven pounds. You add a four-pound lunch and the total changes to eleven. Before the CPU can add anything, it has to find an instruction and work out what that instruction tells it to do.
The till needs instructions and numbers. In a Von Neumann computer, instructions and data share main memory. Buses carry addresses, data and control signals. Inside the CPU, registers hold values, the control unit directs operations, the clock supplies timing pulses and the arithmetic logic unit, or ALU, does calculations and logic.
The program counter holds twenty, the address of the next instruction. The CPU sends that address to main memory along the address bus. The whole instruction, add four, comes back along the data bus and goes into the current instruction register. This copying stage is called fetch.
The program counter held twenty before the fetch, and memory location twenty held an instruction. What goes into the current instruction register during the fetch? Pick the item the CPU copies from memory.
Getting four alone doesn’t tell you what to do. Fetch add four from address twenty and advance the program counter to the next slot, twenty-one. The control unit decodes add four as add the value four itself. It directs the ALU to add seven and four. Eleven goes back into the accumulator.
Now the accumulator holds nine and the CPU has just fetched add six. What happens before the CPU fetches the next instruction? Pick the answer that gets both the order of events and the new total right.
A higher clock speed gives you more clock cycles each second. More cores can run more tasks at once if there’s work to share. A larger cache can hold more instructions and data close to the CPU, so it may spend less time waiting for slower main memory.
In main memory, RAM holds running programs and their data, while ROM can hold start-up instructions. Cache keeps copies the CPU is likely to need. Registers hold values in use. RAM, cache and registers are volatile: they lose their contents without power. ROM and secondary storage keep theirs.
You need secondary storage to keep apps and files when the power is off. Solid-state drives use flash chips and are usually faster than magnetic hard drives, which often cost less per gigabyte. Optical discs are read by a laser. Cloud storage keeps files on remote servers you access over a network.
If the exam asks you to describe the fetch–decode–execute cycle for add four, give the steps in order. The CPU fetches the whole instruction from memory. The control unit works out that it means add four. The ALU adds seven and four, and the accumulator stores eleven before the next fetch.