Beruflich Dokumente
Kultur Dokumente
COMPUTER ORGANIZATION
REGISTER TRANSFER LANGUAGE AND MICROOPERATIONS :
Register Transfer language. Register Transfer, Bus and memory transfers, Arithmetic Mircro-operatiaons, logic
micro operations, shift micro operations, Arithmetic logic shift unit.
2.i OBJECTIVE:In This Unit, we are going to discuss about the Register transfer language, their functionality
and other issues. We are also going to discuss control instructions and data manipulation instructions.
2.ii INTRODUCTION:- About the data transfer and manipulation by using register transfer language. We also
discussed about the various types of instruction formats and addressing modes, computer registers and
finally computer generated control instructions.
Combinational and sequential circuits are used to create simple digital systems. These are the low-level
building blocks of a digital computer. Simple digital systems are frequently characterized in terms of
the registers they contain, and
the operations that they perform.
Micro Operations:The operations on the data in registers are called micro operations.
Ex:- Shift, Load, Clear, Increment etc.
An elementary operation performed (during one clock pulse), on the information stored in one or more
registers is shown below:R <-f(R, R)
f: shift, load, clear, increment, add, subtract, complement, and,
or, xor,
What is meant by REGISTER TRANSFER LEVEL?
Viewing a computer, or any digital system, in the way of
The data transfers between them. is called the register transfer level.
Register Transfer Language:The symbolic notation used to describe the micro operation transfers among registers is called a Register
Transfer Language. For any function of the computer, the register transfer language can be used to describe the
(sequence of) micro operations.
Features of Register transfer language
A symbolic language
PC - program counter.
IR - instruction register.
Registers and their contents can be viewed and represented invarious ways
Registers may also be represented showing the bits of data they contain.
Block diagrams of a register
2.2 Register Transfer: Copying the contents of one register to another is a register transfer.
1.
In this case the contents of register R2 are copied (loaded) into register R1
A simultaneous transfer of all bits from the source R1 to the destination register R2, during one
clock pulse
Note that this is a non-destructive; i.e. the contents of R1 are not altered by copying (loading) them
to R2.
Simultaneous Operations:
If two or more operations are to occur simultaneously, they are separated with commas, these are
called as simultaneous Functions.
Here, if the control function P = 1, load the contents of R5 into R3, and at the same time (clock),
load the contents of register IR into register MAR
Timing Diagram
2.3 Bus and Bus Transfer:Bus is a path (of a group of wires/cables) over which information is transferred, from any of several sources
to any of several destinations.
A typical digital computer has may registers and paths must be provided to transfer information from 1
register to another. As the number of wires will be excessive, a more efficient data transfer method should be used
which uses a common bus structure.
The Transfer of information from a bus into many registers can be accomplished by connecting the bus lines
to the inputs of all destination registers and activating the load control of a particular destination register selected.
From a register to bus: BUS <- R
Constructing a common bus is with multiplexers. The multiplexers select the source register whose binary
information is then placed on the bus. The construction of a bus system for four registers is shown in the fig. Each
register has four bits, numbered 1 through 4.The bus consists of four 4x1 multiplexers each having four data inputs,
and two selection inputs x,y.
Working:The bits in the same significant position in each register are connected to the data inputs of one multiplexer
to form one line of the bus. Mux 0 multiplexes the four 0 bits of the registers, MUX 1 multiplexes the four 1 bits of
the registers and similarly for the other two bits.
4
The two selection lines x, y are connected to the selection inputs all 4 multiplexers. The selection lines
choose the 4 bits of one register and transfer them into the four line common bus. When xy =00, the 0 data inputs of
all four multiplexers are selected and applied to the outputs that form the bus. see the function table for more details.
Transfer from Bus to a Destination Register:In the previous topic we have seen how data was being transferred from register to a bus, whereas in this
topic we will be seeing the opposite of it. Firstly we are going to see bus systems with gates instead of multiplexers.
Three state Bus Buffer:A 3 state gate is a digital circuit that exhibits three states. Two of the states are signals equivalent to logic 0
and logic 1 as in a conventional gate. The third state is a high- impedance state. The third state which means that the
output is disconnected and does not have a logic significance.
The below figure shows 4 registers R0,R1,R2,R3 are connected to a 2X4 decoder and the bus lines are
connected to the bus system. there are two select lines z,w.
The above fig demonstrates how a bus system is used with three state buffers.. The outputs of four buffers
are connected together to form a single bus line. The control inputs determine which of the four normal inputs will
communicate with the bus line. Not more than 1 buffer should be in active state at any given time.
Bus Transfer in RTL:Depending on whether the bus is to be mentioned explicitly or not, register transfer can be indicated as either
In the former case the bus is implicit, but in the latter, it is explicitly indicated.
Memory Transfer: Memory (RAM) can be thought as a sequential circuits containing some number of registers
These registers hold the words of memory
Each of the r registers is indicated by an address
These addresses range from 0 to r-1
Each register (word) can hold n bits of data
Assume the RAM contains r = 2k words. It needs the
following
AR <- DR(AD)
A<- constant
R2 <- ABUS
AR
Address register
DR
Data register
M[R]
Equivalent to M[AR]
DR
2.4 Arithmetic Microoperations:A microoperation is an elementary operation performed with the data stored in registers. The microoperations most
often encountered in digital
computers are classified into four categories:
1. Register transfer microoperations: transfer binary information from one register to another.
2. Arithmetic microoperations: perform arithmetic operations on numeric data stored in registers.
3. Logic microoperations: perform bit manipulation operations on nonnumeric data stored in registers.
4. Shift microoperations: perform shift operations on data stored in registers. .This type of
Micro operation does not change the information content when the binary information moves from the source
register to the destination register. The other three types of micro operations change the information content during
the transfer. In this section we introduce a set of arithmetic micro operations. In the next two sections we present the
logic and shift micro operations
2.4(a) Binary adder:To implement the add microoperation with hardware, we need the registers that hold the data and the digital
components that performs the arithmetic addition. The arithmetic micro operation defined by the statement below
R3 R1 + R2
States that the contents of register R1 are added to the contents of register R2 and the sum transferred to register R3.
The digital circuit generates the arithmetic sum of two binary numbers of any length is called a BINARY
ADDER. It is shown below in binary adder.
The Multiplication operation is implemented with a sequence of addition and shift micro operations.
The Division operation is implemented with a sequence of subtraction and shift micro operations.
The addition and subtraction operations can be combined into one common circuit by including an
Exclusive-OR gate with each Full Adder. Here, the input mode(M) controls the operations, when M=0; the circuit
performs adder operation and when M=1; the circuit performs subtraction operation. Its shown in above diagram.
There are, in principle, 16 different logic functions that can be defined over two
binary input variables. However, most systems only implement four of these: AND (^),
OR (v),
XOR (),
Complement/NOT.
The others can be created from combination of these.
List of Logic Micro operations:There can be16 different logic operations performed with 2 binary variables, The logical operations listed in
the second column represent a relationship between the binary content of two registers A & B. Each bit of the
register is treated as a binary variable and the micro operation is performed on the string of the stored in the
registers.
Hard Ware Implementation of Logic Micro Operations:There are 4 (AND, OR, XOR & Compliment) micro operations used by most computers. Logic Gates are
implemented for each bit or pair of bits in the registers to perform the required logic function.
Logic Diagram
10
The above circuit generates the four basic logic micro operations .It consists of four gates and a multiplexer.S1,
S0 are the two selection inputs. The outputs of the gates are applied to the data input of the multiplexer. The
respective gate performs the respective logic operation.
Function table:
The function table lists out the logic micro operations obtained for each combination of the selection variables.
Applications of Logic Micro Operations: A Logic micro operations can be used to manipulate individual bits or a portions of a word in a register
Consider the data in a register A. In another register, B, is bit data that will be used to modify the contents of
A
Selective Set: In a selective set operation, the bit pattern in B is used to set certain bits in A.
If a bit in B is set to 1, that same position in A gets set to 1, otherwise that bit in A keeps its previous value.
Selective Complement: In a selective complement operation, the bit pattern in B is used to complement certain bits in A .
11
If a bit in B is set to 1, that same position in A gets complemented from its original value, otherwise it is
unchanged.
Selective Clear: In a selective clear operation, the bit pattern in B is used to clear certain bits in A.
In a clear operation, if the bits inthe same position in A and B are the same, they are cleared in A,
otherwise they are set in A
Insert Operation: An insert operation is used to introduce a specific bit pattern into A register, leaving the other bit
unchanged.
This is done as
A mask operation to clear the desired bit positions, followed by
An OR operation to introduce the new bits into the desired positions.
Example
Suppose you wanted to introduce 1010 into the low order four bits of
A: 1101 1000 1011 0001A (Original)
1101 1000 1011 1010A (Desired)
1101 1000 1011 0001 A (Original)
1111 1111 1111 0000 Mask
12
positions
Circular Shift: In a circular shift the serial input is the bit that is shifted out of the other end of the register.
A right circular shift operation:
13
The main distinction of an arithmetic shift is that it must keep the sign of the number the same as
it performs the multiplication or division.
ashr R2
R3
ashlR3
14
Hard Ware Implementation of Shift Microo Operations:The following circuit shows the Hardware required for the Shift micro operations.
Four Multiplexers are required to implement the operations. As indicated 0 indicates shift right(down) and 1
indicates shift left(up).A0 thru A3 are the inputs and H0 thru H3 are the outputs of the operations performed.
2.7 ARITHMETIC LOGIC SHIFT UNIT:The Arithmetic Logic Unit is a single common operational unit in the computer that performs all the micro
operations. Its abbreviated as the ALU. It is a combinational circuit, the results of the operations performed bythe
ALU are stored in a register .The operation performance, and result storage is done in single clock pulse. The one
stage diagram of the ALU looks like this,
Usually, Shift unit is separated from the ALU to make things simpler.
Subscript i indicates a typical stage. Inputs Ai , Bi are applied to both the
arithmetic and logic units.S1 and S0 denote the select inputs. A 4 X 1
multiplexer is used, it chooses between the arithmetic output in Ei and logic
output Hi. Selection inputs S2, S3 are used to select the data by the multiplexer.
The two data i/ps of the multiplexer receive inputs Ai-1 for the shift right
operation and Ai+1 for the shift left operation. The above circuit provides eight
arithmetic operations, four logic and two shift operations in a single stage. S3,
S2, S1, S0&Cin. are the variables that select the operations. Cin is used for
selecting an arithmetic operation only.
Function Table for ALSU
15
16