3instruction Execution Cycle

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

Instruction execution cycle

❑ The operation field of the instruction in IR is examined to determine the type of


operation to be performed by the ALU
❑ The specified operation is performed by obtaining the operand(s) from the memory
locations or from GP registers.
❑ Fetching the operands from the memory requires sending the memory location
address to the MAR and initiating a Read cycle. The operand is read from the
memory into the MDR and then from MDR to the ALU.
❑ The ALU performs the desired operation on one or more operands fetched in this
manner and sends the result either to memory location or to a GP register
❑ The result is sent to MDR and the address of the location where the result is to be
stored is sent to MAR and Write cycle is initiated.
❑ Thus, the execute cycle ends for the current instruction and the PC is incremented to
point to the next instruction for a new fetch cycle.
Normal execution of a program may be preempted (temporarily interrupted) if some
devices require urgent servicing, to do this one device raises an Interrupt signal. An
interrupt is a request signal from an I/O device for service by the processor. The
processor provides the requested service by executing an appropriate interrupt service
routine.. When the interrupt-routine service is completed the state of the processor is
restored so that the interrupted program may continue.
INSTRUCTION CODES
An instruction code is a group of bits that instruct the computer to perform a specific
task.
Two parts
Operation code-specifies the operation
Address-specifies operands, registers or memory word
The most basic part of an instruction code is its operation part.
The Operation Code (OpCode) of an instruction is a group of bits that define each
operation such add, subtract,multiply, shift, and complement.
The control unit decode the OpCode and do the required operation
Instruction code format

The Basic Computer has three instruction code formats.


The OpCode part of the instruction contains three bits and the meaning of the
remaining 13 bits depends on the operation code encountered.
The three instruction code formats are:
• Memory - Reference Instruction
• Register - reference Instruction
• Input - Output Operation
Memory - Reference Instruction
A Memory-Reference instruction uses a 16 bits instruction register, 12 bits to specify
an address 3 bits to specify the opcode and one bit to specify the addressing mode I.
I is equal to 0 for direct address and to 1 for indirect address.
Memory reference instructions performs operations with memory operand

Opcode =000 through 110

There are 7 Memory reference instructions

Symbol Operation Decoder Symbolic Description


AND D0 AC AC ^ M[AR]
ADD D1 AC AC + M[AR]
Register - Reference Instruction
The Register - Reference instruction are recognized by the operation code 111 with 0
in the leftmost bit (bit 15) of the instruction.
It specifies an operation on or a test of the AC register.
Input - Output Instruction
An Input- Output Instruction does not need a reference to memory and recognized
by the operation code 111 with a 1 in the left most bit of the instruction.
The remaining 12 bits are used to specify the type of input-output operation or test
performed.
COMPUTER REGISTERS:
Register is a very fast computer memory, used to store data or instruction in execution.
Following are some commonly used registers:
1. Accumulator: This is the most common register, used to store data taken out from
the memory.
2. General Purpose Registers: This is used to store data intermediate results during
program execution. It can be accessed via assembly programming.
3. Special Purpose Registers: Users do not access these registers. These registers are
for Computer system,
❑ MAR: Memory Address Register are those registers that holds the address for
memory unit.
❑ MBR: Memory Buffer Register stores instruction and data received from the memory
and sent from the memory.
❑ PC: Program Counter points to the next instruction to be executed.
❑ IR: Instruction Register holds the instruction to be executed.
COMPUTER INSTRUCTIONS
The symbol designation is a three-letter word and represents an abbreviation intended
for programmers and users. Memory Reference Instructions
Register Reference Instructions

You might also like