Lec 7

Download as pdf or txt
Download as pdf or txt
You are on page 1of 41

Lecture 7

Register Transfers
Introduction
• The term register is applied to a set of flip-flops, possibly
with added combinational gates, that perform data-
processing tasks.
• Since each flip-flop is capable of storing one bit of
information, an n-bit register, composed of n flip-flops, is
capable of storing n bits of binary information.
• The flip-flops hold data, and the gates determine the new
or transformed data to be transferred into the flip-flops.
Cont.,
• A counter is a register that goes through a predetermined
sequence of states upon the application of clock pulses.
• The gates in the counter are connected in a way that
produces the prescribed sequence of binary states.
• Although counters are a special type of registers, it is
common to differentiate them from registers.
• Registers and counters are sequential functional blocks that
are used extensively in the design of digital systems in
general and in digital computers in particular.
Register with Parallel Load
• Registers are useful for storing and manipulating
information.
• The transfer of new information into a register is referred to
as loading the register.
• If all the bits of the register are loaded simultaneously with
a common clock pulse, we say that the loading is done in
parallel.
Digital System
• A digital system is a sequential circuit made up of
interconnected flip-flops and gates.
• Sequential circuits can be specified by means of
state tables.
• To specify a large digital system with state tables is
very difficult, if not impossible, because the
number of states is prohibitively large.
• To overcome this difficulty, digital systems are
designed using a modular, hierarchical approach.
Cont.,
• In most digital system designs, we partition the
system into two types of modules:
• a datapath, which performs data-processing
operations,
• and a control unit, which determines the
sequence of those operations.
Interaction between Datapath and
Control Unit
Cont.,
• Datapaths are defined by their registers and the
operations performed on binary data stored in the
registers.
• Examples of register operations are load, clear,
shift, and count.
• The registers are assumed to be basic components
of the digital system
Register Transfer Operations
• The movement of the data stored in registers and the
processing performed on the data are referred to as
register transfer operations.
• The register transfer operations of digital systems are
specified by the following three basic components:
1. The set of registers in the system,
2. The operations that are performed on the data
stored in the registers, and
3. The control that supervises the sequence of
operations in the system.
Microoperation
• An elementary operation performed on data
stored in registers is called a microoperation.
• A microoperation is usually, but not always,
performed in parallel on a vector of bits during one
clock cycle.
• Examples of microoperations are:
loading the contents of one register into
another, adding the contents of two registers, and
incrementing the contents of a register.
Cont.,
• The microoperations most often encountered in
digital systems are of four types:
1. Transfer microoperations, which transfer
binary data from one register to another.
2. Arithmetic microoperations, which perform
arithmetic on data in registers.
3. Logic microoperations, which perform bit
manipulation on data in registers.
4. Shift microoperations, which shift data in
registers.
Register Transfer Language (RTL)
• RTL represent registers and specify the operations
on their contents.
• The register transfer language uses a set of
expressions and statements that resemble
statements used in HDLs and programming
languages.
• We denote the registers in a digital system by
uppercase letters.
RTL Basic Symbols
Cont.,
Conditional statement
• A conditional statement, symbolized by the if-then
form:
if (K1 = 1) then (R2 ← R1)
where K1 is a control signal generated in the control
unit.
• A more concise way of writing the If -Then is:
K1: R2 ← R1
• The HW implementation is shown in the following
slide.
Cont.,
Arithmetic Microoperations
• The basic arithmetic microoperations such as add,
subtract, increment, decrement, and complement.
• For example, To implement the following
statement with hardware, we need three registers
and a combinational component that performs the
addition, such as a parallel adder.
R0 ← R1 + R2
Cont.,
Example

Cont.,
Logic Microoperations
• Logic microoperations are useful in manipulating
the bits stored in a register.
• These operations consider each bit in the register
separately and treat it as a binary variable.
Example
• Let the following RTL statement:
(K1 +K2): R1 ← R2+R3, R4 ← R5 V R6
Note: (K1 +K2) , the operation is logical OR.
R2+R3, the operation is ADD.
R5 V R6, the operation is BitwiseOR.
Shift Microoperations
• Shift microoperations are used for lateral
movement of data.
• The contents of a source register can be shifted
either right or left.
• A left shift is toward the most significant bit, and a
right shift is toward the least significant bit.
• Shift microoperations are used in the serial
transfer of data, and for manipulating the contents
of registers in arithmetic, logical, and control
operations.
Assignment 7-1
• Design The Following RTL:
(K1 +K2) : R1 ← R2+R3, R4 ← R5 V R6
Transfer Microoperations
• There are three techniques can be used to transfer
data between registers:
1- Multiplexer-Based Transfer for single
destination register
2- Bus-Based Transfer for Multiple Registers
3- Memory Transfer
1- Multiplexer-Based Transfer

3.1-Multiplexer-Based Transfer

Cont.,

K1 K2 Selection Load of R0
MUX
0 0 R2 -> 0 0
0 1 R2 -> 0 1
1 0 R1 -> 1 1
1 1 R1-> 1 1
HW Implementation
• The HW will be as follows:
2- Bus-Based Transfer for
Multiple Registers
• A typical digital system has many registers.
• Paths must be provided to transfer data from one
register to another.
• A more efficient scheme for transferring data between
registers is a system that uses a shared transfer path
called a bus.
• A bus is characterized by a set of common lines, with
each line driven by selection logic.
• Control signals for the logic select a single source and
one or more destinations on any clock cycle for which a
transfer occurs.
Example
• Implement the following RTL using Bus-based :

• Solution:
1- Set of input registers ={ R0, R1, R2} - we need
MUX with 4 inputs , i.e., two selection inputs S0, S1.
2- Set of output registers = {R0, R1, R2} - we need
three load signals L0, L1, L2.
Cont.,
Three-State Bus
• A bus can be constructed with three-state buffers
instead of multiplexers.
• The reason is that many three-state buffer outputs
can be connected together to form a bit line of a
bus, and this bus is implemented using only one
level of logic gates. (MUX has two levels)
• More important, however, is the fact that signals
can travel in two directions on a three-state bus.
Thus, the three-state bus can use the same
interconnection to carry signals into and out of a
logic circuit.
3- Memory Transfer
• Read operation:
DR ← M [AR]
• Where, an address decoder is needed to select the
contents of address register AR to be loaded onto
address bus.
• Also a data destination decoder will send the Load
signal to the data register DR to load data from
memory on data bus.
Cont.,
• Write operation:
M [AR] ← DR
• Where, an address decoder is needed to select the
contents of address register AR to be loaded onto
address bus.
• Also a data source decoder will send an enable
signal to the data register DR to transfer its
contents through data bus to the memory address
denoted by AR.
Assignment #7-2
• Show the diagram of the hardware that
implements the register transfer statements:
Assignment # 7-3
• Design a memory transfer system that has three
address registers, three data registers, address bus ,
data bidirectional bus, Decoders, and implement
the following statements:
DR1← M [AR2], M [AR1] ← DR2

You might also like