The primary responsibility of a computer processor is to execute a sequential set of instructions that constitute a program. CPU executes each instruction in a series of steps, called instruction cycle .
A instruction cycle involves four steps
Fetching The processor fetches the instruction from the memory. The fetched instruction is placed in the Instruction Register. Program Counter holds the address of next instruction to be fetched and is incremented after each fetch.
Decoding The instruction that is fetched is broken down into parts or decoded. The instruction is translated into commands so that they correspond to those in the CPU’s instruction set. The instruction set architecture of the CPU defines the way in which an instruction is decoded.
Executing The decoded instruction or the command is executed. CPU performs the operation implied by the program instruction. For example, if it is an ADD instruction, addition is performed.
Storing CPU writes back the results of execution, to the computer’s memory.
Instruction cycle
Figure 2.9. Steps in instruction cycle
Instructions are of different categories. Some categories of instructions are—
Memory access or transfer of data between registers.
Arithmetic operations like addition and subtraction.
Logic operations such as AND, OR and NOT.
Control the sequence, conditional connections, etc.
No comments:
Post a Comment