Fetch
In the first step, the CPU retrieves the instruction that it needs to run from program memory. Each instruction in a program (which contains millions of instructions) is stored at a specific address. The CPU has a program counter, which keeps track of the CPU’s position in the program – more specifically, the address of the instruction that the CPU is accessing.
Decode
For this step, it’s important to know that no matter what code a program is written in, the compiler for that specific language breaks the code down to Assembly Language. Assembly language is a language that the CPU understands, but may vary between different CPUs. From there on, an “˜assembler’ translates Assembly Language into binary code, which the CPU can manipulate to execute the instructions it is given.