Once a program is in memory
it has to be executed. To do this, each instruction must be looked at,
decoded and acted upon in turn until the program is completed. This is
achieved by the use of what is termed the 'instruction execution cycle',
which is the cycle by which each instruction in turn is processed. However,
to ensure that the execution proceeds smoothly, it is is also necessary
to synchronise the activites of the processor.
|Diagram showing the basics of the instruction
execution cycle. Each instruction is fetched from memory, decoded,
and then executed.
To keep the events synchronised, the clock located within the CPU control
unit is used. This produces regular pulses on the system bus at a specific
frequency, so that each pulse is an equal time following the last. This
clock pulse frequency is linked to the clock speed of the processor -
the higher the clock speed, the shorter the time between pulses. Actions
only occur when a pulse is detected, so that commands can be kept in
time with each other across the whole computer unit.
The instruction execution cycle can be clearly divided into three different
parts, which will now be looked at in more detail. For more on each part
of the cycle click the relevant heading, or use the next arrow as before
to proceed though each stage in order.
The fetch cycle takes the address required from memory, stores it in the
instruction register, and moves the program counter on one so that it
points to the next instruction.
Here, the control unit checks the instruction that is now stored within
the instruction register. It determines which opcode and addressing mode
have been used, and as such what actions need to be carried out in order
to execute the instruction in question.
The actual actions which occur during the execute cycle of an instruction
depend on both the instruction itself, and the addressing mode specified
to access the data that may be required. However, four main groups of
actions do exist, which are discussed in full later on.
Clicking the next arrow below will take you to further information relating
to the fetch cycle.