PDF of Instruction Format
PDF of Instruction Format
Opcode: The operation code (opcode) represents action that the processor must
execute. It tells the processor what basic operations to perform.
Operands: The operand code defines the parameters of the action and depends
on the operation. It specifies the locations of the data or the operand on which
the operation is to be performed. It can be data or a memory address.
In instruction format, the bits are grouped together in three parts. The first parts
specifies the addressing modes (MODE),the second parts contains the operation code
(OPCODE).And the third part indicates the address of the data(OPERAND).
Instruction Format Types:
PUSH A TOP = A
PUSH B TOP = B
PUSH C TOP = C
PUSH D TOP = D
LOAD A AC = M[A]
ADD B AC = AC + M[B]
STORE T M[T] = AC
LOAD C AC = M[C]
ADD D AC = AC + M[D]
MUL T AC = AC * M[T]
STORE X M[X] = AC
3.Two Address Instructions :
This is common in commercial computers. Here two addresses can be
specified in the instruction. Unlike earlier in one address instruction, the result was
stored in the accumulator, here the result can be stored at different locations rather
than just accumulators, but require more number of bit to represent address.
Here destination address can also
contain operand.
Expression: X = (A+B)*(C+D)
R1, R2 are registers
M[] is any memory location
MOV R2, C R2 = C
ADD R2, D R2 = R2 + D
MUL R1, R2 R1 = R1 * R2
MOV X, R1 M[X] = R1
4.Three Address Instructions :
This has three address field to specify a register or a memory location. Program created
are much short in size but number of bits per instruction increase. These instructions make
creation of program much easier but it does not mean that program will run much faster
because now instruction only contain more information but each micro operation
(changing content of register, loading address in address bus etc.) will be performed in one
cycle only.
Expression: X = (A+B)*(C+D)
R1, R2 are registers
M[] is any memory location
All programs do communicate with the processor using these instruction sets.
These involve a series of logical operations that perform a complete task. The
processor understands the coded instructions.
Instruction Cycle:
• The time taken for the execution of an instruction is known as Instruction Cycle.
2. Decoding: The instruction that is fetched is broken down into parts or decoded. The
instruction is translated into commands so that they correspond to those in the CPU’s
instruction set. The instruction set architecture of the CPU defines the way in which an
instruction is decoded.
4. Storing: CPU writes back the results of execution, to the computer’s memory.
Thank You …...
Any questions ….?