Chapter 4
Chapter 4
1
Outlines
Register Transfer Language
Register transfer
Arithmetic Operations
Logic Operations
2
Register Transfer Language
Digital systems are composed of modules that are constructed from
digital components, such as registers, decoders, arithmetic elements,
and control logic
The modules are interconnected with common data and control paths to
form a digital computer system
Modules can be defined by the registers they contain and operations that
are performed on the data stored in them
The operations executed on data stored in registers are called
microoperations
A microoperation is an elementary operation performed on the information
stored in one or more registers, Examples are shift, count, clear, and load
Some of the digital components are registers that implement
microoperations
E.g. a counter with parallel loading is capable of performing the
microoperation load and increment
3
Register Transfer Language …
The internal hardware organization of a digital computer is best defined
by specifying
Set of registers it contains and their function
transfer language.
The term register transfer implies availability of logic circuits for performing
MOs and transfer results of the operations to another (or same) register.
4
Register Transfer
Registers are designated by capital letters followed by optional number:
5
Register Transfer …
The information transfer from one register to another is designate in symbolic
form by means of a replacement operator.
Register transfer: R2 ←R1
transfers the content of register R1into register R2,The content of R1remains intact
Implies that the necessary hardware for performing the transfer is available
And that the destination register has a parallel load capability
6
Register Transfer …
Transfer from R1 to R2 when P = 1, example
7
Register Transfer …
8
Bus and Memory Transfer
A typical computer system has multiple register, which path
needed to transfer information from one register to other register
Using separate line between each register is increase the number of
lines in the system
An efficient scheme for transferring information between registers
in multiple register configuration is using common bus system
A bus structure consists of a set of common lines, one for each bit
of a registers
Control signals determine which register is selected by the bus
during each transfer
9
Bus and Memory Transfer….
One way of constructing common bus is using multiplexer
10
Bus and Memory Transfer….
The number of multiplexers equals the bus width n.
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
The bus can be stated explicitly in the register transfer statement:
BUS ←C, R1 ←BUS
12
Bus and Memory Transfer….
Bus system can be also constructed with 3-state buffers
A three-state gate is a digital circuit that exhibits three states
13
Bus and Memory Transfer….
The three-state buffer gate has a normal input and a control input
Decoders are used to ensure that no more than one control input is
transfer operations
Read: DR ← M[AR]
Write: M[AR] ← R1
17
Arithmetic Micro-operations…
Add micro-operation:
R3←R1 + R2
To implement this statement with hardware we need three registers and addition
circuits.
Subtract micro-operation:
R3←R1 + R2 +1
Multiply and divide are not included as microoperations, A microoperation is one that
can be executed by one clock pulse
Multiply (divide) is implemented by a sequence of add and shift microoperations
(subtract and shift)
18
Arithmetic Micro-operations…..
Arithmetic micro-operations
19
Arithmetic Micro-operations….
To implement the add microoperation with hardware, we need the
registers that hold the data and the digital component that performs the
addition
Binary adder is a digital circuit that generates the arithmetic sum of two
binary numbers of any length.
Full-adder form the arithmetic sum of two bits and a previous carry
22
Arithmetic Micro-operations….
The increment operation adds one to a number in a register, e.g.:
The other inputs receive the number to be incremented or the carry from
The output carry C4is 1 only after incrementing binary 1111. This causes
24
Arithmetic Micro-operations….
Each of the arithmetic microoperations can be implemented in one
composite arithmetic circuit
Basic component is parallel adder.
Control inputs are used to obtain different types of arithmetic operations
Output: D= A+ Y+ Cin
25
Arithmetic Micro-operations….
With S0, S1,and Cin is possible to control the value of Y, and the
operation of the 4-bit adder
26
Logic Micro-operations
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(R1 ⊕ R2 ) after P = 1
Symbols used for logical microoperations:
OR: ∨
AND: ∧
XOR: ⊕
27
Logic Micro-operations…..
The ‘+’ sign has two different meanings: logical OR and summation
Example: P + Q: R1 ← R2 + R3, R4 ← R5 ∨ R6
There are 16 different logic operations that can be performed with two
binary variables
28
Logic Micro-operations….
29
Logic Micro-operations…..
Hardware implementation
The hardware implementation of logic microoperations requires that logic
gates be inserted for each bit or pair of bits in the registers
All 16 microoperations can be derived from using four logic
gates(AND,OR,XOR,complement)
30
Logic Micro-operations…..
Some applications
corresponding 1’s in B
1010 A before
1100 B (logic operand)
1110 A after selective-set
microoperation)
31
Logic Micro-operations…..
The selective-complement operation complements bits in A where there
34
Shift Microoperations
Shift microoperations are used for serial transfer of data
They are also used in conjunction with arithmetic, logic, and other data
processing operations
The symbols shl and shr are for logical shift-left and shift-right by one
position
R1 ← shl R1
35
Shift Microoperations….
The circular shift (aka rotate) circulates the bits of the register around the
The arithmetic shift shifts a signed binary number to the left or right
A sign reversal occurs if the bit in Rn-1 changes in value after the shift
this
Two clock pulses are necessary with this configuration: one to load the
38
?
Thank you!!!
39