Computer Architecture for Btech(CS) BCA/MCA or BSc (CS) student who are pursuing there graduation this will be very helpful for you.
Understand each concept clearly and share with your friends
1. Instruction
An instruction is just an order or command given to machine to do some specific task often
these instructions are written in high level language therefore we need to translate them into
machine format to execute them on hardware.
When high level instructions is translated into machine format it is converted in a
specific instruction format.
Opcode Operand
Such an instruction format has following two parts:-
Opcode ->specifies operation code
Operand->contains address or the operand itself on which operation is to be performed.
The instruction format may vary from one architecture to another. There are two types of
instruction format
(i)- Horizontal Format
(ii)- Vertical Format
A horizontal instruction format is faster then vertical instruction format involves additional
decoding to identify source and destination operand even to distinguish between the
operations.
Types of instruction
Depending upon the types of operations and no. Of operands the instruction have been
classified into different categories as given below.
On the basis of number of operands:-
(i)Zero Address Instruction.
(ii)One Address Instruction.
(iii)Two Address Instruction.
(iv)Three Address Instruction.
On the basis of types of operations:-
(i) Data Transfer Instruction.
(ii) Data Manipulation Instruction.
(iii) Program Control Instruction.
On the basis of number of operands:-
1. Zero Address Instruction.
Number of operand is given along with instruction.
Example PUSH, POP
2. One Address Instruction.
This instruction works with a single operand however the second operand is assumed as
accumulator.
Example
2. MUL A // Ac=Ac * A
INC CL // CL=CL*1
DEC AH // AH=AH-1
3. Two Address Instruction.
There are two operands used with an instruction to perform operations however the first
operand is treated as destination and source operand both
E.g
ADD A, B //A=A+B
SUB AX , C // AX= AX-C
MUL AX, AH //AC= AC* AH
Memory Variable --- A, B, C, D, a, b, c…….etc
Register variable Ax, Bx , Cy……etc
4. Three Address Instruction.
In a thrree address instruction there are three operands the first operand is treated as
destination operand where as the last two operand are treated as source operand.
For example
AX=BX+CX
On the basis of types of operations
1. Data Transfer Instruction
Such instruction are used to transfer data from one place to another however such instructions
are used to LOAD or STORE constant values within varibales or used to perform I/O
operations directly from input output ports.
2. Data Manipulation Instruction
Such instruction are used to perform different types of operations on the operands therfore
such instructions are further categorised into following sub categories
I. Airthmetic Instruction
II. Logical Instruction
III. Shift Microperation
Airthmetic Instruction
ADD Addition ADD Ax,Bx
SUB Substraction SUB A, C // A= A-C
MUL Multiplication MUL Ax,B // Ax =Ax*B
Logical operation
AND Logical AND AND AH, AL
OR Logical OR OR CL, 00H
3. NOT Logical NOT NOT Ac
XOR Logical XOR XOR AC , CL
Shift Microoperation
The shift microoperation are used to manipulate data contained within shift registers.
Depending upon types of shifting the shift microperation have been classififed into
following categories
1. Normal Shift
2. Arithmetic Shift
3. Circular Shift
1. Normal Shift
• Left Shift
it doubles the value
• Right shift
it half the values (integer division)
2. Arithmetic Shift
In a arithmetic shift when MSB or LSB gets vaccant due to shfting the privious LSB
or previous MSB is copied as it is at vaccant place respectively.
3. Circular Shift
In this Microoperation the bit that goes outwards due to shifting the bits either
4. leftwards or rightwards is going to be related back to be placed at vaccant
place. The circular shift microoperaetion is also called as rotation.
Shift Microinstruction
SHL --- Shift left
SHR ---Shift Right
ASHL ---Airthmetic Shift left
ASHR ----Arithmetic Shift Right
ROL---- Rotate Left
ROR ----Rotate Right
Cache Memory
It has been observed that practically that maximum of CPU time has been
wasted in executing common task or excessing common values in association
with loops therefore the concept of local memory of processor itself has been
evaluated improve the performance of computer.
The cache memory is an intermediate
memory placed in between the processor and the memory module it is called as
local memory of processor itself. It is based upon the concept of locality of
reference that is when the processor needs to access same value it checks the
cache for availabilty of data meanwhile the main memory is free to be accessed
by other operations.
5. There are two types of cache
1. L1 cache (inside processor)
2. L2 cache
The L1 cache is placed within processor itself and is fixed size whereas the L2
cache is placed outside the processor which is reconfigurable.