The document discusses the instruction cycle in computers. It explains that the instruction cycle helps ensure instructions are executed in a predetermined manner and outlines three views of the instruction cycle - basic, intermediate, and exceptions. The intermediate view explains that the cycle follows the steps of fetch, decode, and execute. Exceptions can occur at various points in the cycle, such as during addressing, operation, or execution due to issues like invalid memory, operations, or input data errors. Once an instruction completes without exceptions, the next instruction is fetched to begin the cycle again.
2. The Instruction Cycle
• Instruction Cycle helps to tell us the completion of instruction
execution in a predetermined manner.
• The Instruction Cycle can be
– Basic
– Intermediate
– Exceptions
3. The Instruction Cycle - Basic View
• Once the computer has been
started it continually executes
instructions
• Different instructions take
different amounts of time to
execute
• All instructions and data are
stored in main memory
Fetch
Instruction
Start
Execute
Instruction
4. The Instruction Cycle - Intermediate View
• Instruction Cycle follows
– Fetch
– Decode and
– Execute
• A complete instruction consists of
– operation code
– addressing mode
– zero or more operands
• immediately available data
• the address where the data
can be found in main memory
Fetch
Instruction
Start
Execute
Instruction
Fetch
Operand
Decode
Instruction
5. The Instruction Cycle - Exceptions
• Exceptions, or errors, may occur at
various points in the instruction
cycle, for example:
Fetch
Instruction
Start
Execute
Instruction
Fetch
Operand
Decode
Instruction
Possible
Exception
?
Possible
Exception
?
Possible
Exception
?
Possible
Exception?
6. The Instruction Cycle - Exceptions
• Exceptions, or errors, may occur at
various points in the instruction
cycle, for example:
– Addressing - the memory does not
exist or is inaccessible
Fetch
Instruction
Start
Execute
Instruction
Fetch
Operand
Decode
Instruction
7. The Instruction Cycle - Exceptions
• Exceptions, or errors, may occur at
various points in the instruction
cycle, for example:
– Operation - the operation code does
not denote a valid operation
Fetch
Instruction
Start
Execute
Instruction
Fetch
Operand
Decode
Instruction
8. The Instruction Cycle - Exceptions
• Exceptions, or errors, may occur at
various points in the instruction
cycle, for example:
– Execution - the instruction logic fails,
typically due to the input data
• divide by zero
• integer addition/subtraction
overflow
• floating point underflow/overflow
Fetch
Instruction
Start
Execute
Instruction
Fetch
Operand
Decode
Instruction
9. Completion of Execution
• Once the instruction has no exception, it follows
the cycle and completes its execution
• After completion the next instruction will be
fetched and take into consideration for
execution