Professional Documents
Culture Documents
Unit1 Addressing Modes and GPR
Unit1 Addressing Modes and GPR
Unit1 Addressing Modes and GPR
By
SHIVANI AGARWAL
Department of Computer Science & Engineering
IMS Engineering College, Ghaziabad
Register Transfer language
A digital computer system exhibits an interconnection of
digital modules such as registers, decoders, arithmetic
elements, and Control logic.
These digital modules are interconnected with some
common data and control paths to form a complete digital
system.
Moreover, digital modules are best defined by the registers
and the operations that are performed on the data stored in
them.
The operations performed on the data stored in registers
are called Micro-operations.
MICROINSTRUCTIONS &
OPERATIONS
R1: A+B
R1 M[A] + M[B] MICRO OPERATION
R1 M[A] + M[B] ,R2 R1 MICRO
INSTRUCTION
Shift operations:-
1. Logical Shift left
2. Logical shift right
3. Arithmetic shift left
4. Arithmetic shift right
5. Rotate left
6. Rotate right
7. Rotate left with carry
8. Rotate right with carry
Program Control Instructions
When CPU process the data from consecutive memory
locations so each time one instruction is fetched from
memory and the program counter is incremented.
It has two types of instructions:-
1) Unconditional
2) Conditional
Unconditional:- An unconditional branch instruction
means control proceeds the next instruction in
sequence.
Conditional:- A conditional branch instruction means
control proceeds the next instruction when the
condition met .
Program Control Instructions
JUMP
SKIP
BRANCH
CALL
RETURN
COMPARE
General Purpose Register
Organization
Generally CPU has seven general registers. Register
organization show how registers are selected and how data
flow between register and ALU. A decoder is used to
select a particular register. The output of each register is
connected to the multiplexers to form the two buses A and
B. The selection lines in each multiplexer select the input
data for the particular bus.
The A and B buses form the two inputs of an ALU. The
operation select lines decide the micro operation to be
performed by ALU. The result of the micro operation is
available at the output bus. The output bus connected to the
inputs of all registers, thus by selecting a destination register
it is possible to store the result in it.
General Purpose Register
Organization
General Purpose Register
Organization
I S0 S1 Y0 Y1 Y2 Y3
I 0 0 Y0 0 0 0
I 0 1 0 Y1 0 0
I 1 0 0 0 Y2 0
I 1 1 0 0 0 Y3
Y0=IS0’S1’
Y1=IS0’S1 Y2=IS0S1’ Y3 IS0S1
Instruction Format
Computer perform task on the basis of instruction provided.
An instruction in computer comprises of groups called
fields. These field contains different information as for
computers every thing is in 0 and 1 so each field has
different significance on the basis of which a CPU decide
what to perform. The most common fields are:
Operation field which specifies the operation to be
performed like addition.
Address field which contain the location of operand, i.e.,
register or memory location.
Mode field which specifies how operand is to be founded.
Instruction Format
Generally CPU organization are of three types on the basis of
number of address fields:
General register organization
Single Accumulator organization
Stack organization
Three Address Instructions :-This has three address field to
specify a register or a memory location. 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
Op-code
in one cycle only.
Destination Source1 Source2
Instruction Format
Expression: X = (A+B)*(C+D)
R1, R2 are registers and M[] is any memory location.
X = (A+B)*(C+D)
ADD R1, A, B [ where R1=A+B] R1 = M[A] + M[B]
ADD R2, C, D [ where R2=C+D] R2 = M[C] + M[D]
MUL X, R1, R2 M[X] = R1 * R2
Advantage:- It result in very short program.
Disadvantage:- it required too many bits to specify this
format.
Instruction Format
Two Address Instructions :- This is common in
commercial computers. Here two address can be specified in
the instruction.
In this format we use move instruction to transfer the
registers from the memory or processor register.