Assignment 2 (Instruction Cycle) PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Computer Architecture

Topic: “Instruction cycle”


Umair Khan
Section: MCS-2D
Student ID: MCSM-F19-164
Instructor: Naseer Ahmed
Faculty of CS & IT, Gold Campus, Superior University
INSTRUCTION CYCLE

A program residing in the memory unit of a computer consists of a sequence


of instructions. These instructions are executed by the processor by going through a
cycle for each instruction.

Registers Involved in Each Instruction Cycle:

• Memory address registers (MAR): It is connected to the address lines of the


system bus. It specifies the address in memory for a read or write operation.
• Memory Buffer Register (MBR): It is connected to the data lines of the system
bus. It contains the value to be stored in memory or the last value read from the
memory.
• Program Counter (PC): Holds the address of the next instruction to be
fetched.
• Instruction Register (IR): Holds the last instruction fetched.

In a basic computer, each instruction cycle consists of the following phases:

1. Fetch the instruction from memory. This step brings the instruction into
the instruction register, a circuit that holds the instruction so that it can be decoded
and executed.

• Obtain next instruction from memory.


• Load instruction into instruction register IR.
• MAR is loaded with instruction pointer.
• The instruction is loaded through the MDR.
• Increment processor counter PC, that is, update instruction pointer address
while reading instruction from memory.
• Memory Circuitry:

2. Decode the instruction.


• Decoder circuit examines opcode of the instruction. •

• Result is selecting unique decoder output line.


• Output line signals a circuit which implements the corresponding operation

3. Read the effective address from memory if the instruction has an indirect address.

• Compute address of the memory location of the instruction operand.

• Memory Circuitry:

4. Execute the instruction


The term refers to both the series of four steps and also the amount of time
that it takes to carry out the four steps. An instruction cycle also is called machine
cycle.

You might also like