Computer Science I / The Instruction Execution Cycle
Practice question · Put in order

A jump instruction sits at address 40 and jumps to address 80. Instructions are 4 bytes long. Order what happens.

Hints
  1. The PC advances during the fetch, long before anyone knows the instruction is a jump.
  2. The jump's new address can only be written once the instruction has been decoded and run.
Show the answer
  1. The PC holds 40, so the CPU fetches the instruction stored at address 40
  2. The PC advances to 44
  3. The control unit decodes the instruction and finds it is a jump to 80
  4. The execute step writes 80 into the PC, replacing the 44
  5. The next fetch reads the instruction at address 80
Why

The PC is advanced to 44 automatically during the fetch, because the hardware does not yet know what it has fetched. Only when the instruction executes is 44 overwritten with 80. This is the whole mechanism of a jump: no magic, just a later write to the same register.

Read the lesson: The Instruction Execution Cycle →

Practise The Instruction Execution Cycle

The app has 8 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.

More questions on The Instruction Execution Cycle