Last Updated on 2021-10-20 by Clay
Central Processing Unit is referred to as CPU, its main job is to execute the program using the so-called fetch-decode-execute cycle.
- Fetch: Fetch the commands from memory
- Decode: Decode the commands
- Execute: Execute the commands
The detailed steps as follows:
- The Processor checks the Program Counter (PC) to confirm the next instruction to be executed.
- The Program Counter gives the memory address of the instruction to be executed.
- The processor fetch the instruction value from the memory.
- After fetching the instruction, decode it and execute it. For example: take a value into the Arithmetic Logic Unit (ALU), and take a different value from the register and add the two values.
- After completing the instruction, the processor returns to the program counter to confirm the next instruction to run
- Repeat this cycle until the end of the program
References
- https://www.youtube.com/watch?v=XM4lGflQFvA
- https://www.bbc.co.uk/bitesize/guides/z2342hv/revision/5
- https://blog.csdn.net/weixin_44551646/article/details/97279348