Loading player…
The Fetch-Execute Cycle: What's Your Computer Actually Doing?
Trace one trip through the CPU
A simplified CPU stores one instruction at each address. Its program counter holds 40, its accumulator holds 7, and address 40 contains ADD 3. Here, 3 is an immediate value. What will both registers hold after one instruction?
Check your reasoning
Fetch. The CPU copies address 40 to the memory address register, reads the instruction into the memory data register and copies it to the instruction register. The program counter advances to 41.
Decode and execute. The control unit identifies an addition with the operand 3. The arithmetic logic unit adds 3 to 7 and returns 10 to the accumulator. The program counter still holds 41.
Now replace ADD 3 with an unconditional JUMP 12. Fetch still advances the counter to 41, but executing the jump overwrites it with 12. The accumulator stays at 7.
Did this explanation help you?
Your answer helps us choose lessons for other students.