CPU (Central Processing Unit):
CPU or central processing unit is an electronic circuitry that carries out the instruction given by a computer program. CPU execute instruction by performing basic arithmetic, logical, control and I/O operations as required per instruction. CPU is considered to be the brain of the computer. The speed and efficiency of a computer mostly depends that of it's CPU.
CPU can execute instructions on it only. But as the program can be very large, CPU loads the program in the main memory (RAM) and then fetches instructions one by one from the memory to the CPU registers and executes them
Steps in Instruction Execution by CPU:
Six steps are involved in execution an instruction by CPU. However, not each of them are required for any instructions.
Step 1: Fetch instruction
Execution cycle starts with fetching instruction from main memory. The instruction at the current program counter (PC) will be fetched and will be stored in instruction register (IR).
Step 2: Decode instruction
During this cycle the encoded instruction present in the IR (instruction register) is interpreted by the decoder.