Let’s look at this how this laundry example plays out in the digital world. In order for the CPU to execute an instruction, it will go through the instruction cycle which is comprised of the following steps:
- Fetch Instruction
- Decode Instruction
- Memory Access
- Registry Write Back
The goal is that each step would take one cycle. This is not always the case because some instructions take longer and there are more steps than this in a modern CPU, but one step per cycle is the ideal situation. If the system ran one instruction after another sequentially, each instruction would take five cycles to complete; if we had four instructions to process (a crazy simple request for a CPU), it would take a total of 20 cycles.
Examine the steps involved in processing instructions:
Take a look at the image to the right. Similar to the laundry example in the last exercise, the processor completes one entire instruction before moving onto the next.