Define instruction cycle and mention its steps

The instruction cycle, also known as the fetch-decode-execute cycle or the fetch-execute cycle, is the basic process that a computer's central processing unit (CPU) follows to execute a program instruction. It consists of the following steps:

1. Fetch: The CPU fetches or retrieves the next instruction from the computer's memory, typically from the program counter. The program counter holds the memory address of the next instruction to be executed.

2. Decode: The fetched instruction is decoded to determine the operation to be performed. This decoding process identifies the operation code (opcode) and any associated operands or addressing modes required for the instruction.

3. Execute: The CPU carries out the instruction's operation by performing the necessary calculations or actions. This step can involve data manipulation, arithmetic or logical operations, memory access, or branching to another instruction location.

4. Store: If the instruction performed any calculations or produced a result, the CPU stores the result back into memory or registers. This step ensures that the result is available for subsequent instructions or for output to devices.

After completing the store step, the CPU then proceeds to repeat the cycle from the fetch step, fetching the next instruction in the sequence. This process continues until the program execution is complete or interrupted.