0% found this document useful (0 votes)
38 views60 pages

Chapter 2

Uploaded by

harishchaisirhc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views60 pages

Chapter 2

Uploaded by

harishchaisirhc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 60

Chapter 2

Register Transfer and


Microoperations
(5 Hrs)
Prepared By: Rolisha Sthapit
Contents
2.1 Register Transfer Language: Microoperation, Register
Transfer Language, Register Transfer, Control Function
2.2 Arithmetic Microoperations: List of Arithmetic
Microoperations, Binary Adder, Binary Adder-subtractor, Binary
Incrementer, Arithmetic Circuit
2.3 Logic Microoperations: List of Logic Microoperations,
Hardware Implementation, Applications of Logic
Microoperations.
2.4 Shift Microoperations: Logical Shift, Circular shift,
Arithmetic Shift, Hardware Implementation of Shifter.
2.1 Register and Register Transfer
Language (RTL)
Register:
• Register is the storage device, inside CPU, of data on
which
microoperations are performed.
• 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. The
result of the operation may replace the previous binary information
of a register or may be transferred to another register. Examples of
microoperations are shift, count, clear and load.
• The internal hardware organization of a digital computer is best
defined by specifying:
- The set of registers it contains and their function.
- The sequence of microoperations performed on the binary
information stored in the registers.
- The control that initiates the sequence of microoperations.
• The language, which is basically used to express the transfer
of data among the registers, is called Register Transfer
Language (RTL). It is the symbolic notation used to describe
the microoperation transfers among registers. In such transfer,
one of the source or destination should be register (not
necessarily both).
Register Transfer
• Computer registers are designated by capital letters.
• For example, the register that holds an address for the memory unit
is usually called a memory address register and is designated by the
name MAR. Other designations for registers are PC (for program
counter), IR (for instruction register, and R1 (for processor register).
• The most common way to represent a register is by a rectangular
box with the name of the register inside. Fig (a).
• The individual flip-flops in an n-bit register are numbered in
sequence from 0 through n-1, starting from 0 in the rightmost
position and increasing the numbers toward the left. For e.g. 8-bit
register numbered: Fig (b).
• The numbering of bits in a 8-bit register can be marked on top of the
box. Fig (c).
• A 16-bit register is partitioned into two parts in (d). Bits 0 through 7 are
assigned the symbol L (for low byte) and bits 8 through 15 are assigned the
symbol H (for high byte). The name of the 16 bit register is PC. The
symbol PC(0—7) or PC(L) refers to the low order byte and PC(8—15) or
PC(H) to the high order byte.
• Information transfer from one register to another is designated in
symbolic
form by means of a replacement operator. R2 R1
Control function
If there is predetermined control condition like If (P=1) then
(R2 R1), then we can write the statement as
P: R2 R1
where P is control signal usually a control function which
is Boolean variable that is equal to 1 or 0.
• The n outputs of register R1 are connected to the n inputs of
register R2. The letter n will be used to indicate any number of
bits for the register.
• It is assumed that all transfers occur during a clock edge
transition. Even though the control condition such as P
becomes active just after time t, the actual transfer does not
occur until the register is triggered by the next positive
transition of the clock at time t + 1.
• A comma is used to separate two or more operations that are
executed at the same time. The statement
T: R2 R1, R1 R2
denotes an operation that exchanges the contents of two registers
during one common clock pulse provided that T = 1.
Bus and Memory Transfer
Bus
• A typical digital computer has many registers, and paths must be
provided to transfer information from one register to another. The
number of wires will be excessive if separate lines are used between
each register and all other registers in the system.
• A more efficient scheme for transferring information between
registers in a multiple register configuration is a common bus
system.
• A bus structure consists of a set of common lines, one for each bit of
a register, through which binary information is transferred one at a
time. Control signals determine which register is selected by the bus
during each particular register transfer.
• In general, a bus system will multiplex k registers of n bits
each to produce an n line common bus. The number of
multiplexers needed to construct the bus is equal to n, the
number of bits in each register. The size of each multiplexer
must be k X 1 since it multiplexes k data lines.
• For example, a common bus for eight registers of 16 bits each
requires 16 multiplexers, one for each line in the bus. Each
multiplexer must have eight data input lines and three selection
lines to multiplex one significant bit in the eight registers.
• The transfer of information from a bus into one of many
destination registers can be accomplished by connecting the
bus lines to the inputs of all destination registers and activating
the load control of the particular destination register selected.
Memory Transfer
• The transfer of information from a memory word to the outside
environment is called a read operation. The transfer of new
information to be stored into the memory is called a write operation.
• A memory word will be symbolized by the letter M. The particular
memory word among the many available is selected by the memory
address during the transfer.
• Consider a memory unit that receives the address from a register,
called the address register, symbolized by AR. The data are
transferred to another register, called the data register, symbolized
by DR. The read operation can be stated as follows:
Read: DR M[AR] `
This causes a transfer of information into DR from the memory word
M selected by the address in AR.
• The write operation
• The write operation transfers the content of data register to a
memory word M selected by memory address. Assume that the
input data are in register R1 and the address in AR, the write
operation can be stated as:
Write: M[AR] R1
This causes a transfer of information from R1
into the
memory word M selected by the address in R.
Microoperations and its types
• The operations on the data in registers are called microoperations.
• Alternatively we can say that an elementary operation performed
during one clock pulse on the information stored in one or more
registers is called micro-operation.
• The result of the operation may replace the previous binary
information of the resister or may be transferred to another resister.
Register Transfer Language (RTL) can be used to describe the
(sequence of) micro-operations.
• The microoperations most often encountered in digital computers
are classified into 4 categories:
i) Register transfer microoperations
ii) Arithmetic microoperations
iii) Logic microoperations
iv) Shift microoperations
2.2 Arithmetic Microoperation
• The arithmetic are:
subtraction, microoperations increment
basic addition, The
and
arithmetic operations decrement.
are additional
with carry, subtract with borrow and
transfer/load.
Binary

Adder
To implement the add microoperation with hardware, we need the resisters
that hold the data and the digital component that performs the arithmetic
addition. The digital circuit that generates the arithmetic sum of two binary
numbers of any lengths is called Binary adder. The binary adder is
constructed with the full-adder circuit connected in cascade, with the output
carry from one full-adder connected to the input carry of the next full-
adder.
Binary Subtractor
• The subtraction A – B can be done by taking the 2's
complement of B and adding to A. It means if we use the
inverters to make 1’s complement of B (connecting each Bi to
an inverter) and then add 1 to the least significant bit (by
setting carry C0 to 1) of binary adder, then we can make a
binary subtractor.
Binary Adder-Subtractor
• The addition and subtraction operations can be combined into
one common circuit by including an exclusive-OR gate with
each full-adder.
Binary Incrementer
• The increment microoperation adds one to a number in a
register. For example, if a 4-bit register has a binary value
0110, it will go to 0111 after it is incremented. Increment
microoperation can be done with a combinational circuit (half-
adders connected in cascade) independent of a particular
register.
Arithmetic Circuit
• The arithmetic microoperations can be implemented in one
composite arithmetic circuit. By controlling the data inputs to the
adder (basic component of an arithmetic circuit), it is possible to
obtain different types of arithmetic operations. In the circuit below
contains:
- 4 full-adders
- 4 multiplexers (controlled by selection inputs S0 and S1)
- two 4-bit inputs A and B and a 4-bit output D
-Input carry cin goes to the carry input of the full-adder.
Output of the binary adder is calculated from the arithmetic sum:
D = A + Y + cin .
By controlling the value of Y with the two selection inputs S1 & S0 and
making cin= 0 or 1, it is possible to generate the 8 arithmetic
microoperations listed in the table below:
2.3 Logic Microoperations
• Logic microoperations are bit-wise operations, i.e., they work
on the individual bits of data. Useful for bit manipulations on
binary data and for making logical decisions based on the bit
value. 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 (٧), XOR (⊕), Complement/NOT
• The others can be created from combination of these four
functions.
Hardware implementation
• Hardware implementation of logic microoperations requires
that logic gates be inserted be each bit or pair of bits in the
registers to perform the required logic operation.
Applications of Logic Microoperations
• Logic Microoperations can be used to manipulate
individual bits or a portion of a word in a register.
• Individual bits of a registers are operated with
other corresponding register bits.
• They can be used to change values, delete a group of bits or
insert new bit values into a register.

Consider a data in register A . In other 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. 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. If a bit in B is set to 1, that same position in A gets set to 0, otherwise it is
unchanged.

Mask Operation
In a mask operation, the bit pattern in B is used to clear certain bits in A. If a
bit in B is set to 0, that same position in A gets set to 0, otherwise it is
unchanged.
Clear Operation
In a clear operation, if the bits in the 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 positions unchanged. This is done as 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 0001 (Original)
1101 1000 1011 1010 (Desired)
2.4 Shift Microoperation
• The operation that changes the adjacent bit position of the
binary values stored in the register is known as shift
microoperation. They are used for serial transfer of data. The
shift microoperations are classified into 3 types:
1. Logical Shift
2. Circular Shift
3. Arithmetic Shift
1. Logical
Shift: A logical shift is the one that transfers 0 through the serial
input. In RTL, following notation is used
- shr for logical shift right (R3 shr R3)
- shl for logical shift left (R4 shl R4)

Example
44 = 01000101
shr = 00100010
shl = 10001010
2. Circular Shift:
Circular shift circulates the bits of the register around the two ends
without the loss of information. It is also known as rotate operation.

Example
00101100
cir =
00010110
cil =
01011000
3. Arithmetic Shift Operation
An arithmetic shift is meant for signed binary numbers
(integer). An arithmetic left shift multiplies a signed number by
two and an arithmetic right shift divides a signed number by two.
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.
a. Arithmetic Shift Right:
It leaves the signed bit unchanged and shifts the number
including the signed bit to the right.

Eg: 10110010
ashr : 11011001
b. Arithmetic Shift Left:
It inserts a 0 into last bit and shifts all other bits to the left.
The initial bit is lost.

Eg: 10110100
ashl : 01101000
Overflow Case during arithmetic shift
left
Hardware Implementation of shift
microoperations
A combinational circuit shifter can be constructed with multiplexers as shown below:
Arithmetic Logic Shift Unit
• Arithmetic logic shift unit is a digital circuit that performs
arithmetic calculations, logical manipulation and shift
operation. It is often abbreviated as ALU. The above figure
shows the one stage of arithmetic logic shift unit.
• The block diagram of ALU includes one stage of arithmetic
circuit, one stage of logic circuit and one 4*1 multiplexer. The
subscript i designates a typical stage.
• Inputs Ai and Bi are applied to both the arithmetic and logic
units. A particular microoperation is selected with inputs S1
and S0. A 4*1 MUX selects the final output. The two inputs of
the MUX are received from the output of the arithmetic circuit
and logic circuit. The other two is Ai-1 for the shift-right
operation and Ai+1 for the shift left operation. The circuit is
repeated n times for n-bit ALU. The output carry Ci+1 is
connected to the input carry Cin. In every stage the circuit
specifies 8 arithmetic operations, 4 logical operations and 2
shift operations, where each operation is selected by the five
variables S3, S2, S1, S0 and Cin.
• The operations of ALU can be summarized in table below:
Three State Buffer
A three state gate is a digital circuit that exhibits three state. Two
of the states are signed equivalent to logic 1 and 0 as in a
conventional gate. The third state is a high impedance state. The
high impedance state behaves likes an open circuit which means
that the output is disconnected and does not have a logic
significance.
Three state gate may perform any conventional logic such
as AND or NAND. However, the most commonly used in the
design of bus system is the buffer gate,
Numerical
Numerical
SOLUTION:

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy