You are on page 1of 69

WOLO UNIVERSITY (KIOT)

DEPARTMENT OF ECE
Computer architecture and organization

Chapter four: register transfer and microoperations
Lecture slides


Prepared by: welday G.
Email: weldayg@gmail.com

May 10, 2014
1
B
y

W
e
l
d
a
y

G
.

CHAPTER FOUR: REGISTER TRANSFER
AND MICRO OPERATION
B
y

W
e
l
d
a
y

G
.

2
Contents
Overview of computer components
Micro-operation and RTL
Connecting registers and bus design
Memory transfer, read and write
Basic micro-operations
Some applications of micro-operations
Q

Overview of computer compenents
3
B
y

W
e
l
d
a
y

G
.

CONTD
4
B
y

W
e
l
d
a
y

G
.

Basic operational concepts of the compenents
5
B
y

W
e
l
d
a
y

G
.

CONTENTS
B
y

W
e
l
d
a
y

G
.

6
Overview of computer compenents
Micro-operation and RTL
Connecting registers and bus design
Memory transfer, read and write
Basic micro-operations
Some applications of micro-operations
Q

Micro operation
micro small, operation task
A microoperation is an elementary operation performed on the
information stored in one or more registers in one instruction
cycle.
Usually, it consist of the following 4 categories:
Register transfer: transfer data from one register to another
Arithmetic micro-operation
Logic micro-operation
Shift micro-operation






B
y

W
e
l
d
a
y

G
.

7
Micro operation Contd
B
y

W
e
l
d
a
y

G
.

8
Register Transfer Language (RTL)
Digital systems are composed of modules that are constructed
from digital components, such as
registers,
decoders,
arithmetic elements,
and control logic, etc..
The modules are interconnected with common data and control
paths to form a digital computer system



B
y

W
e
l
d
a
y

G
.

9
RTL contd
Rather than specifying a digital system in words, a specific notation is
used, register transfer language
For any function of the computer, the register transfer language can be
used to describe the (sequence of) microoperations
Register transfer language
A symbolic language
A convenient tool for describing the internal organization of digital computers
Can also be used to facilitate the design process of digital systems



B
y

W
e
l
d
a
y

G
.

10
DESIGNATION OF REGISTERS
B
y

W
e
l
d
a
y

G
.

11
Designation contd
B
y

W
e
l
d
a
y

G
.

12
Register Transfer
B
y

W
e
l
d
a
y

G
.

13
Control Functions
B
y

W
e
l
d
a
y

G
.

14
Hence: The Data Transfer Becomes Controlled
B
y

W
e
l
d
a
y

G
.

15
Simultaneous operations
If two or more operations are to occur simultaneously, they
are separated with commas
P: R3 R5, MAR IR
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


B
y

W
e
l
d
a
y

G
.

16
Basic symbols for register transfers
B
y

W
e
l
d
a
y

G
.

17
CONTENTS
B
y

W
e
l
d
a
y

G
.

18
Overview of computer compenents
Micro-operation and RTL
Connecting registers and bus design
Memory transfer, read and write
Basic micro-operations
Some applications of micro-operations
Qu


Connecting registers
In a digital system with many registers, it is impractical to have data
and control lines to directly allow each register to be loaded with the
contents of every possible other registers
To completely connect n registers n(n-1) lines
This icost O(n
2
) cost very costy
This is not a realistic approach to use in a large digital
system
Solution Have one centralized set of circuits for
data transfer the bus
Have control circuits to select which register is the
source, and which is the destination







B
y

W
e
l
d
a
y

G
.

19
Bus and bus transfer using control circuits
Bus is a path(of a group of wires) over which information is
transferred, from any of several sources to any of several
destinations.
A bus structure consists of a set of common lines, one for
each bit of a register





Multiplexers can be used to construct a common bus







B
y

W
e
l
d
a
y

G
.

20
4 bit common bus line architecture
B
y

W
e
l
d
a
y

G
.

21
Contd..
Multiplexers select the source register whose binary
information is then placed on the bus
The select lines are connected to the selection inputs of the
multiplexers and choose the bits of one register
Question: develop a truth table which register will
access the bus based on the values of the control signals
(select lines) Ans: see the ff table



S1 S0 Decimal eqv.t Register accessing
bus
0 0 0 A
0 1 1 B
1 0 2 C
1 1 3 D
B
y

W
e
l
d
a
y

G
.

22
Contd
In general, a bus system will multiplex K registers of n bits
each to produce an n-line common bus
This requires n multiplexers one for each bit expensive
The size of each multiplexer must be K x 1
The number of select lines required is log2 K
To transfer information from the bus to a register, the bus lines
are connected to the inputs of all destination registers and the
corresponding load control line must be activated



B
y

W
e
l
d
a
y

G
.

23
Exercise
A bus system multiplexes 8 registers. If the width of the
common bus is 8 bit.
A) what is the size of the mux?
B) how many select lines do we need?
C) what is the size of each registers?
D) draw the diagram
E) develop the truth table to which register accesses the bus with
respect to the select signals.
Ans: hint answer from the statements of previous slide?


B
y

W
e
l
d
a
y

G
.

24
Buses can also be designed using three state gates
Instead of using multiplexers, three-state gates can be
used to construct the bus system line without
endangering loading effects .





Fig Three state block diagram
With control input 1, the output equals the normal input
With control input 0, the gate goes to a high-impedance
state (disabled)






B
y

W
e
l
d
a
y

G
.

25
Contd
This enables a large number of three-state gate
outputs to be connected with wires to form a common
bus line
Decoders are used to ensure that no more than one
control input is active at any given time
To construct a common bus for four registers of n bits
each using three-state buffers, we need n circuits
with four buffers in each
Only one decoder is necessary to select between the
four registers

B
y

W
e
l
d
a
y

G
.

26
Bus line with three state buffer diagram
B
y

W
e
l
d
a
y

G
.

27
CONTENTS
B
y

W
e
l
d
a
y

G
.

28
Overview of computer compenents
Micro-operation and RTL
Connecting registers and bus design
Memory transfer, read and write
Basic micro-operations
Some applications of microoperations
Qui

.


B
y

W
e
l
d
a
y

G
.

29
B
y

W
e
l
d
a
y

G
.

30
Contd.
B
y

W
e
l
d
a
y

G
.

31
Contd
B
y

W
e
l
d
a
y

G
.

32
CONTENTS
B
y

W
e
l
d
a
y

G
.

33
Overview of computer compenents
Micro-operation and RTL
Connecting registers and bus design
Memory transfer, read and write
Basic micro-operations
Some applications of micro-operations
Qui


Micro operations
B
y

W
e
l
d
a
y

G
.

34
1) Register transfer operations
B
y

W
e
l
d
a
y

G
.

35
2) Arithmetic
36
B
y

W
e
l
d
a
y

G
.

Addition
Addition is done by binary adder circuit
Binary adder is constructed with full-adder circuits connected in cascade
See the following block diagram of 4 bit full adder adding A and B










It uses three inputs and two outputs
The third input is carry out from the lower bit.


37
B
y

W
e
l
d
a
y

G
.

Full- Adder
It adds 3-bits, it has 3-inputs and 2-outputs
We will use x, y and z for inputs and s for sum and c for carry are the
two outputs.
The truth table (z represents the first carry)
x

y

z

c

s

0

0

0

0

0

0

0

1

0

1

0

1

0

0

1

0

1

1

1

0

1

0

0

0

1

1

0

1

1

0

1

1

0

1

0

1

1

1

1

1

B
y

W
e
l
d
a
y

G
.

38
C= z (x y) + xy
S= x y z
Putting them together
we get:
The logic diagram for the full adder
FULL ADDER
B
y

W
e
l
d
a
y

G
.

39
Exersise: draw the block diagram, truth taable and
logic diagram for half adder
Arithmetic subtraction:
R3 R1 + R2 + 1
where R2 is the 1s complement of R2.
Adding 1 to the ones complement is equivalent to taking the 2s
complement of R2 and adding it to R1.
The addition and subtraction operations can be combined into one
common circuit by including an exclusive-OR gate with each full-
adder.
NB. Division and multiplications are not microoperations. Why?
(1 mark)
40
B
y

W
e
l
d
a
y

G
.

BINARY ADDER SUBTRATOR
41
B
y

W
e
l
d
a
y

G
.

Description of binary adder subtracter
When M = 0: Note that B XOR 0 = B. This is
exactly the same as the binary adder with carry in
Co = 0. the circuit works as binary adder.
When M = 1: Note that B XOR 1 = B (flip all B bits).
i.e if B=0, output is 1, and if B=1, output is 0. The
outputs of the XOR gates are thus the 1s complement
of B.
M = 1 also provides a carry in 1. The entire operation
is: A + B + 1. the circuit works as subtractor.

42
B
y

W
e
l
d
a
y

G
.

Binary incrementor
Incrementing means adding a digit 1 (0000001) to an existing binary
number.
Can be implemented using half adder circuit.
Half adder circuit accepts two inputs and provides two outputs

43
B
y

W
e
l
d
a
y

G
.

44
B
y

W
e
l
d
a
y

G
.

45
B
y

W
e
l
d
a
y

G
.

EXAMPLES
1. Logical shift: Transfers 0 through the serial input.
R1 shl R1 Logical shift-left
R2 shr R2 Logical shift-right
(Example 1) Logical shift-left
10100011 01000110
(Example 2) Logical shift-right
10100011 01010001

Exersise: do the logical shift for the
hexadecimal values 0Ah and 32h and for the
decimal value 21. hint: convert it first to binury.

46
B
y

W
e
l
d
a
y

G
.

47
B
y

W
e
l
d
a
y

G
.

EXAMPLES
(Example 1) Circular shift-left
10100011 is shifted to 01000111
(Example 2) Circular shift-right
10100011 is shifted to 11010001

For the following given R1 values find R2 cil R1
and R3 cil R1
R1= 101010
R1=5h
R1=00h
R1=1Fh
R1=15
Practice for any value of your own


48
B
y

W
e
l
d
a
y

G
.

49
B
y

W
e
l
d
a
y

G
.

EXAMPLE..
Arithmetic Shift Right :
Example 1
0100 (4)
0010 (2)
Example 2
1010 (-6)
1101 (-3)
NB. In signed numbers if the first digit (MSB) is
0 the number is positive. If it is 1 it is negative.
50
B
y

W
e
l
d
a
y

G
.

ARITHMETIC SHIFT LEFT
2 2 R ashl R
LSB
Carry out
Sign bit
R
n-1
R
n-2
Vs=1 : Overflow
Vs=0 : use sign bit
LSB
0 insert
The operation is same with Logic shift-left
The only difference is you need to check overflow
problem (Check BEFORE the shift)
B
y

W
e
l
d
a
y

G
.

51
EXAMPLES
B
y

W
e
l
d
a
y

G
.

52
Arithmetic Shift Left :
Example 1
0010 (2)
0100 (4)
Example 2
1110 (-2)
1100 (-4)

Arithmetic Shift Left :
Example 3
0100 (4)
1000 (overflow)
Example 4
1010 (-6)
0100 (overflow)

With no overflow With overflow
53
B
y

W
e
l
d
a
y

G
.

EXAMPLE.
Example: 011011

SHL 110110
SHR 001101
CiL 110110
CiR 101101
ASHL Overflow
ASHR 001101
Exersise: do all the above shift operation for the bit
sequence 101101100. repeat for the binury value
1Ah.
54
B
y

W
e
l
d
a
y

G
.

Logic microoperations
Refers to manipulating bits stored in register
There are four basic logic microperations.other
operations can be derived from these. see table
55
B
y

W
e
l
d
a
y

G
.

CONTD
Logic operations specify binary operations for strings
of bits stored in registers and treat each bit
separately
Example: the XOR of R1 and R2 is symbolized by
P: R1 R1 R2
Example: R1 = 1010 and R2 = 1100
1010 Content of R1
1100 Content of R2
0110 Content of R1 after P = 1
Symbols used for logical microoperations:
OR:
AND:
XOR:
56
B
y

W
e
l
d
a
y

G
.

Logic circuit
In computers a single logic circuit is implemented for all
the micro-operations instead of separate circuit for each
micro-operation.
The select (control) signals will control which logic is to be
implemented at a time














57
B
y

W
e
l
d
a
y

G
.

Exersise
Extend the previous logic circuit to accommodate XNOR,
NAND, NOR, and the complement of the second input.
S2 S1 S0 Output Operation
0 0 0 X Y AND
0 0 1 X Y OR
0 1 0 X Y XOR
0 1 1 A Complement A
1 0 0 (X Y) NAND
1 0 1 (X Y) NOR
1 1 0 (X Y) XNOR
1 1 1 B Complement B
CONTENTS
B
y

W
e
l
d
a
y

G
.

59
Overview of computer compenents
Micro-operation and RTL
Connecting registers and bus design
Memory transfer, read and write
Basic micro-operations
Some applications of micro-operations
Quiz


60
B
y

W
e
l
d
a
y

G
.

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
Here the 2
nd
bit of A is set to one selectively
i.e. + is to mean OR operation.
The + sign has two different meanings:
logical OR and summation
When + is in a microoperation, then summation
When + is in a control function, then OR



61
B
y

W
e
l
d
a
y

G
.

CONTD.
62
B
y

W
e
l
d
a
y

G
.

CONTD
63
B
y

W
e
l
d
a
y

G
.

CONTD
64
B
y

W
e
l
d
a
y

G
.

65
B
y

W
e
l
d
a
y

G
.

summary
Micro-operations are the tasks performed by register in
a single instruction cycle
We use register transfer language to perform
operations
Common bus and circuit to design digital systems
There are four basic micro-operations. i.e. transfer,
arithmetic, logical and shift.
Acessing and working with memory
Multiplexers,Truth tables,Logic diagam
Applications of micro-operations

66
B
y

W
e
l
d
a
y

G
.

IF YOU HAVE ANY QUESTION?????


67
B
y

W
e
l
d
a
y

G
.

CONTENTS
B
y

W
e
l
d
a
y

G
.

68
Overview of computer compenents
Micro-operation and RTL
Connecting registers and bus design
Memory transfer, read and write
Basic micro-operations
Some applications of micro-operations
Quiz

10 Q V. MUCH
EGGER TO KNOW!
STUDY HARD !!!
69
B
y

W
e
l
d
a
y

G
.

You might also like