0% found this document useful (0 votes)
2K views3 pages

Instruction Cycle: Instruction Sub-Cycle Instruction Fetch and Execute Cycles

The basic instruction cycle consists of two steps: the fetch cycle and the execute cycle. In the fetch cycle, the processor fetches the next instruction from memory using the program counter and loads it into the instruction register. In the execute cycle, the processor interprets the instruction and performs the required actions, which can include transferring data between processor and memory/I/O, performing arithmetic/logic operations, or altering the execution sequence. The full instruction cycle involves additional sub-steps like calculating instruction/operand addresses and fetching operands.

Uploaded by

SANJAY NAYAK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views3 pages

Instruction Cycle: Instruction Sub-Cycle Instruction Fetch and Execute Cycles

The basic instruction cycle consists of two steps: the fetch cycle and the execute cycle. In the fetch cycle, the processor fetches the next instruction from memory using the program counter and loads it into the instruction register. In the execute cycle, the processor interprets the instruction and performs the required actions, which can include transferring data between processor and memory/I/O, performing arithmetic/logic operations, or altering the execution sequence. The full instruction cycle involves additional sub-steps like calculating instruction/operand addresses and fetching operands.

Uploaded by

SANJAY NAYAK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Instruction Cycle

The basic function performed by a computer is execution of a program, which consists of a set of
instructions stored in memory. The processor does the actual work by executing instructions
specified in the program. In its simplest form, instruction processing consists of two steps: The
processor reads (fetches) instructions from memory one at a time and executes each instruction.
Program execution consists of repeating the process of instruction fetch and instruction
execution. The Instruction execution may involve several operations and depends on the nature
of the instruction.
The processing required for a single instruction is called an instruction cycle. Using the
simplified two-step description given previously, the instruction cycle is depicted in Figure 1

Figure 1: Basic instruction cycle

The two steps are referred to as the fetch cycle and the execute cycle. Program execution halts
only if the machine is turned off, some sort of unrecoverable error occurs, or a program
instruction that halts the computer is encountered.

Instruction Sub-Cycle
Instruction Fetch and Execute Cycles
Fetch Cycle:
 Program Counter (PC) holds address of next instruction to fetch
 Processor fetches instruction from memory location pointed to by PC
 Increment PC (Unless told otherwise)
 Instruction loaded into Instruction Register (IR)
 Processor interprets instruction and performs required actions
At the beginning of each instruction cycle, the processor fetches an instruction from memory. In
a typical processor, a register called the program counter (PC) holds the address of the
instruction to be fetched next. Unless told otherwise, the processor always increments the PC
after each instruction fetch so that it will fetch the next instruction in sequence. The fetched
instruction is loaded into a register in the processor known as the instruction register (IR). The
instruction contains bits that specify the action the processor is to take. The processor interprets
the instruction and performs the required action.

Execute Cycle:
In general, the required actions fall into four categories:

 Processor-memory: Data may be transferred from processor to memory or from memory


to processor.
 Processor-I/O: Data may be transferred to or from a peripheral device by transferring
between the processor and an I/O module.
 Data processing: The processor may perform some arithmetic or logic operation on data.
 Control: An instruction may specify that the sequence of execution be altered.
 An instruction’s execution may involve a combination of these actions.

Instruction Cycle State Diagram:

Figure 2 provides a more detailed look at the basic instruction cycle. The figure is in the form of
a state diagram. For any given instruction cycle, some stales may be null and others may be
visited more than once. The states can be described as follows:

Figure 2: Instruction cycle state diagram

 Instruction address calculation (iac): Determine the address of the next instruction to be
executed. Usually, this involves adding a fixed number to the address of the previous
instruction. For example, if each instruction is 16 bits long and memory is organized into
16-bit words, then add 1 to the previous address. If, instead, memory is organized as
individually addressable 8-bit bytes, then add 2 to the previous address.
 Instruction fetch (if): Read instruction from its memory location into the processor.
 Instruction operation decoding (iod): Analyze instruction to determine type of operation
to he performed and operand(s) to be used.
 Operand address calculation (oac): If the operation involves reference to an operand in
memory or available via I/O. then determine the address of the operand.
 Operand fetch (of): Fetch the operand from memory or read it in from I/O,
 Data operation (do): Perform the operation indicated in the instruction.
 Operand store (os): Write the result into memory or out to I/O

You might also like