For the execution of an instruction, we need to perform an instruction
cycle. An instruction cycle consists of two phase,
- Fetch cycle and
- Execution cycle.
Most of the operation of a CPU can be carried out by performing
one or more of the following functions in some prespecified sequence:
- Fetch the contents of a given memory location and load them into a CPU
register.
- Store a word of data from a CPU register into a given memory location.
- Transfer a word of data from one CPU register to another or to the ALU.
- Perform an arithmatic or logic operation, and store the result in a
CPU register.
Now we will examine the way in which each of the above functions is
implemented in a computer. Fetching a Word from Memory:
Information is stored in memory location indentified by their address. To
fetch a word from memory, the CPU has to specify the address of the memory
location where this information is stored and request a Read operation. The information may include both, the data for an operation or the
instruction of a program which is available in main memory.