The CPU instruction cycle — Computing, 11–13
A processor does not understand a whole program at once. It repeatedly fetches one instruction, works out what it says, carries it out, and then moves to the next one.
One instruction at a time
A CPU works more like a reader following a recipe than like a person seeing the whole plan. It takes the next instruction, decides which tiny operation it asks for, performs it, and keeps its place for what comes next.
Why this cycle exists
A computer needs a reliable way to turn stored instructions into action. Breaking work into tiny steps lets the same hardware run many programs; without this cycle, a program would be only a passive list of words.
Adding two numbers
Suppose a program must calculate 7 + 5. First, the CPU fetches the instruction to add; next it fetches 7 and 5, decodes the operation, and performs it; finally, it stores 12 and fetches the next instruction.
The CPU does not think
It is natural to say that a CPU understands a game or makes a clever choice, because its results can look intelligent. In fact, it follows permitted instructions extremely quickly; if the instructions are wrong, speed only produces the wrong result sooner.
Why speed matters
Every click, sound, calculation, and moving image requires many instruction cycles. A faster CPU can complete more cycles each second, but a fast processor cannot repair unclear instructions or a program that asks it to do unnecessary work.
Keep exploring
Other languages
Loading MyLeoNes™…