Computer Architecture 2 Year-Iiird Semester Unit-1
Computer Architecture 2 Year-Iiird Semester Unit-1
Computer Architecture 2 Year-Iiird Semester Unit-1
The following block diagram shows a Bus system for four registers. It is
constructed with the help of four 4 * 1 Multiplexers each having four data
inputs (0 through 3) and two selection inputs (S1 and S2).
The two selection lines S1 and S2 are connected to the selection inputs
of all four multiplexers. The selection lines choose the four bits of one
register and transfer them into the four-line common bus.
The two selection lines S1 and S2 are connected to the selection inputs
of all four multiplexers. The selection lines choose the four bits of one
register and transfer them into the four-line common bus.
When both of the select lines are at low logic, i.e. S1S0 = 00, the 0 data
inputs of all four multiplexers are selected and applied to the outputs that
forms the bus. This, in turn, causes the bus lines to receive the content
of register A since the outputs of this register are connected to the 0
data inputs of the multiplexers.
Similarly, when S1S0 = 01, register B is selected, and the bus lines will
receive the content provided by register B.
The following function table shows the register that is selected by the
bus for each of the four possible binary values of the Selection lines.
Arithmetic Micro-Operations
Some of the basic micro-operations are addition, subtraction, increment
and decrement.
1.Add Micro-Operation
It is defined by the following statement:
R3 → R1 + R2
The above statement instructs the data or contents of register R1 to be
added to data or content of register R2 and the sum should be
transferred to register R3.
2.Subtract Micro-Operation
Let us again take an example:
R3 → R1 + R2' + 1
In subtract micro-operation, instead of using minus operator we take 1's
compliment and add 1 to the register which gets subtracted, i.e R1 -
R2 is equivalent to R3 → R1 + R2' + 1
3.Increment/Decrement Micro-Operation
Increment and decrement micro-operations are generally performed by
adding and subtracting 1 to and from the register respectively
R1 → R1 + 1
R1 → R1 – 1
Symbolic Designation Description
R3 ← R1 + R2 Contents of R1+R2 transferred to R3.
R3 ← R1 - R2 Contents of R1-R2 transferred to R3.
R2 ← (R2)' Compliment the contents of R2.
R2 ← (R2)' + 1 2's compliment the contents of R2.
R3 ← R1 + (R2)' + 1 R1 + the 2's compliment of R2 (subtraction).
R1 ← R1 + 1 Increment the contents of R1 by 1.
R1 ← R1 - 1 Decrement the contents of R1 by 1.
Logic Micro-Operations
These are binary micro-operations performed on the bits stored in the
registers. These operations consider each bit separately and treat them
as binary variables.
Let us consider the X-OR micro-operation with the contents of two
registers R1 and R2.
P: R1 ← R1 X-OR R2
In the above statement we have also included a Control Function.
Assume that each register has 3 bits. Let the content of R1 be 010 and
R2 be 100. The X-OR micro-operation will be:
Shift Micro-Operations
These are used for serial transfer of data. That means we can shift the
contents of the register to the left or right. In the shift left operation the
serial input transfers a bit to the right most position and in shift
right operation the serial input transfers a bit to the left most position.
There are three types of shifts as follows:
a) Logical Shift
It transfers 0 through the serial input. The symbol "shl" is used for
logical shift left and "shr" is used for logical shift right.
R1 ← she R1
R1 ← she R1
The register symbol must be same on both sides of arrows.
b) Circular Shift
This circulates or rotates the bits of register around the two ends without
any loss of data or contents. In this, the serial output of the shift register
is connected to its serial input. "cil" and "cir" is used for circular shift
left and right respectively.
c) Arithmetic Shift
This shifts a signed binary number to left or right. An arithmetic shift
left multiplies a signed binary number by 2 and shift left divides the
number by 2. Arithmetic shift micro-operation leaves the sign bit
unchanged because the signed number remains same when it is
multiplied or divided by 2.
Instruction Codes
While a Program, as we all know, is, A set of instructions that specify
the operations, operands, and the sequence by which processing has to
occur. An instruction code is a group of bits that tells the computer to
perform a specific operation part.
Instruction Code: Operation Code
The operation code of an instruction is a group of bits that define
operations such as add, subtract, multiply, shift and compliment. The
number of bits required for the operation code depends upon the total
number of operations available on the computer. The operation code
must consist of at least n bits for a given 2^n operations. The operation
part of an instruction code specifies the operation to be performed.
3. Input-Output Instruction
These instructions are recognized by the operation code 111 with a 1 in
the left most bit of instruction. The remaining 12 bits are used to specify
the input-output operation.
Format of Instruction
The format of an instruction is depicted in a rectangular box symbolizing
the bits of an instruction. Basic fields of an instruction format are given
below:
Instruction Cycle
An instruction cycle, also known as fetch-decode-execute cycle is the
basic operational process of a computer. This process is repeated
continuously by CPU from boot up to shut down of computer.
Following are the steps that occur during an instruction cycle:
SELD or
Binary code SELA SELB SELREG
001 R1 R1 R1
010 R2 R2 R2
011 R3 R3 R3
100 R4 R4 R4
101 R5 R5 R5
110 R6 R6 R6
111 R7 R7 R7
Operation with symbol:
Operation
selection code Operation symbol
0110 A OR B OR
Stack Organization
Instruction Formats
Difference between RISC and CISC
Types of Pipeline
It is divided into 2 categories:
1. Arithmetic Pipeline
2. Instruction Pipeline
Arithmetic Pipeline
Arithmetic pipelines are usually found in most of the computers. They
are used for floating point operations, multiplication of fixed point
numbers etc. For example: The input to the Floating Point Adder pipeline
is:
X = A*2^a
Y = B*2^b
Here A and B are mantissas (significant digit of floating point numbers),
while a and b are exponents.
The floating point addition and subtraction is done in 4 parts:
Registers are used for storing the intermediate results between the
above operations.
Instruction Pipeline
In this a stream of instructions can be executed by
overlapping fetch, decode and execute phases of an instruction cycle.
This type of technique is used to increase the throughput of the
computer system.
An instruction pipeline reads instruction from the memory while previous
instructions are being executed in other segments of the pipeline. Thus
we can execute multiple instructions simultaneously. The pipeline will be
more efficient if the instruction cycle is divided into segments of equal
duration.