0% found this document useful (0 votes)
16 views29 pages

COA Chapter 3

Chapter Three discusses register transfer and microoperations in digital systems, focusing on the organization of registers, their functions, and the operations performed on them. It introduces register transfer language (RTL) as a notation for describing microoperations, including arithmetic, logic, and shift operations. The chapter also covers memory operations, control functions, and the use of multiplexers and buses for efficient data transfer between registers.

Uploaded by

zumayaomer
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)
16 views29 pages

COA Chapter 3

Chapter Three discusses register transfer and microoperations in digital systems, focusing on the organization of registers, their functions, and the operations performed on them. It introduces register transfer language (RTL) as a notation for describing microoperations, including arithmetic, logic, and shift operations. The chapter also covers memory operations, control functions, and the use of multiplexers and buses for efficient data transfer between registers.

Uploaded by

zumayaomer
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/ 29

Chapter Three

REGISTER TRANSFER AND


MICROOPERATIONS
• A digital system is characterized by an interconnection of
digital hardware modules
• These modules are frequently characterized in terms of
– the registers they contain, and
– the operations on the data stored in them
• A n-bit register is a set of n flip-flops that is capable of storing n bits of
binary information. With added combinational gates, the register can
perform data-processing tasks.

• The operations on the data in registers are called


microoperations. These operations are the functions built
into registers . For example;
– Shift
– Load
– Clear
– Increment
• The result of the operation may replace the previous binary
ORGANIZATION OF A DIGITAL SYSTEM
 Hence, Definition of the (internal) organization of a
computer is best defined by specifying
 Set of registers and their functions

 The micro-operations set is the sequence of micro-operation


performed on the binary information stored in the registers.

 Control signals that initiate the sequence of microoperations

REGISTER TRANSFER LEVEL


Viewing a computer, or any digital system, in this way is called the
register transfer level
This is because we’re focusing on
 The system’s registers
 The data transformations in them, and
 The data transfers between them.
REGISTER TRANSFER LANGUAGE
• Rather than specifying a sequence of microperation in digital system in
words, a specific notation is used, called register transfer language
• The term “register transfer” refers to the availability of a hardware logic
circuit that performs a stated microoperation and transfer the result of the
operation to the same or another register.
– R1 <- R1 + R2
– Above statement of RTL specifies that system has circuit to perform addition and
then saving the result in R1

• 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.
REGISTER TRANSFER
• Copying the contents of one register to another is a register
transfer

• A register transfer is indicated as


R2  R1

– In this case the contents of register R1 are copied


(loaded) into register R2
– 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
Register Transfer
CONTROL FUNCTIONS
• Often actions need to only occur if a certain condition is true
• This is similar to an “if” statement in a programming
language
• In digital systems, this is often done via a control signal,
called a control function which is a Boolean variable that is
equal to 1 or 0.
– If the signal is 1, the action takes place
• This is represented as:

P: R2  R1
Which means “if P = 1, then load the contents of
register R1 into register R2”,
i.e., if (P = 1) then (R2  R1)
TRIGGERING OF FLIP-FLOPS
 Level-triggering is the transfer of data from input to output of
a flip-flop anytime the clock pulse is in proper voltage level.

 Edge-triggering is the transfer of data from input to output


of a flip-flop on the rising edge (L-to-H) or falling edge (H-
to-L) of the clock pulse. Edge triggering may be either
positive-edge (L-to-H) or negative-edge (H-to-L). An edge-
triggered flip-flop ignores the pulse while it is at a constant
level and triggers only during a transition of the clock signal
NGT-Negative Going Transition
PGT-Positive Going Transition
Negative-edge triggering
Positive-edge triggering

L
time
Level triggering
SIMULTANEOUS OPERATIONS
• If two or more operations are to occur simultaneously, they are separated with
commas

P: R3  R5, R1  R2
• 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 R2 into register R1

BASIC SYMBOLS FOR REGISTER TRANSFERS


Symbols Description Examples
Capital letters Denotes a register R1, R2
& numerals
Parentheses () Denotes a part of a register R2(0-7), R2(L)

Arrow  Denotes transfer of information R2  R1


Colon : Denotes termination of control function P:
Comma , Separates two micro-operations A  B, B  A

rj (15-8) ←ri (L). This means bit b8 to b15 in rj are transferred from lower byte of ri
CONNECTING REGISTRS
• 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 but This is not a realistic approach
to use in a large digital system
• Instead, take a different approach: Have one centralized set of circuits for data
transfer – called the common bus system.
• Bus is a path (a group of wires- one for each bit of a register ) over which
information is transferred, from any of several sources to any of several
destinations at a time.
• Have control signals to select which register is the source, and which is the
destination
• One way of constructing a common bus system is with multiplexers.

For example From a register to bus: BUS  R

Register A Register B Register C Register D

Bus lines
Multiplexer
• It is a combinational circuit that selects binary information
from one of the input lines and directs it to a single output
line
• Usually there are 2n input lines and n selection lines. The
bit combinations of the section lines determine which input
line is selected.
• For example for 2-to-1 multiplexer
– if selection S is zero then I0 has the path to output (it will be
selected )
– if S is one then I1 has the path to output – will be selected
2-to-1 multiplexer

x+0=x identity law


X. 1 =X identity law
MEMORY (RAM)
• Memory (RAM) can be thought as a collection of storage cells
together with associated circuits needed to transfer information in
and out of storage.
• a word is a group of bits in the memory that moves in and out of
storage as a unit.(or at once) Each word can hold n bits of data
• Each of the r word is indicated by an address. These addresses range
from 0 to r-1
• Assume the RAM contains 2k words. Then It needs the following:
– n data input lines
– n data output lines data input lines
n
– k address lines so that 2k words can be addressed
address lines
– A Read control line k RAM
– A Write control line Read Unit
Write 2k
n bits per word
n
data output lines
MEMORY TRANSFER
• Since it contains multiple locations, we must specify which address
in memory we will be using
• This is done by indexing memory references
• Memory is usually accessed in computer systems by putting the
desired address in a special register, the Memory Address Register
(MAR), or the Address Register (AR)
• When memory is accessed, the contents of the MAR get sent to the
memory unit’s address lines.

M
Read
Memory
AR unit
Write

Data out Data in


MEMORY READ and WRITE
• To read a value from a location in memory and load it into a register, the register
transfer language notation looks like this:
R1  M[MAR]
• This causes the following to occur
– The contents of the MAR get sent to the memory address lines
– A Read control line (= 1) gets sent to the memory unit
– The contents of the specified address are put on the memory’s output data lines
– The data values get sent over the bus to be loaded into register R1

• To write a value from a register to a location in memory looks like this in register
transfer language:

M[MAR]  R1
• This causes the following to occur
– The contents of the MAR get sent to the memory address lines
– A Write control line (= 1) gets sent to the memory unit
– The values in register R1 get sent over the bus to the data input lines of the memory
– The values get loaded into the specified address in the memory
SUMMARY OF REGISTER TRANSFER MICROOPERATIONS

A B Transfer content of reg. B into reg. A


AR DR(AD) Transfer content of AD portion of reg. DR into reg. AR
A  constant Transfer a binary constant into reg. A
ABUS  R1, Transfer content of R1 into bus A and, at the same time, transfer
R2 ABUS content of bus A into R2
AR Address register
DR Data register
M[R] Memory word specified by reg. R
M Equivalent to M[AR]
DR  M Memory read operation: transfers content of
memory word specified by AR into DR
M  DR Memory write operation: transfers content of
DR into memory word specified by AR
MICROOPERATIONS

 Computer system microoperations are of four types:

- Register transfer microoperations: transfer of binary


information from one register to the other.
- Arithmetic microoperations: perform arthemetic
operations on numeric data stored in registers.
- Logic microoperations; perform bit manipulation
operations on non-numeric data stored in registers.
- Shift microoperations: perform shift operations on
data stored on registers.
Arithmetic Microoperations

ARITHMETIC MICROOPERATIONS
• The basic arithmetic microoperations are
– Addition
– Subtraction
– Increment
– Decrement

• The additional arithmetic microoperations are


– Add with carry
– Transfer/Load
– etc. …

Summary of Typical Arithmetic Micro-Operations


R3  R1 + R2 Contents of R1 plus R2 transferred to R3
R3  R1 - R2 Contents of R1 minus R2 transferred to R3
R2  R2’ Complement the contents of R2
R2  R2’+ 1 2's complement the contents of R2 (negate)
R3  R1 + R2’+ 1 subtraction
R1  R1 + 1 Increment
R1  R1 – 1 Decrement
Binary Subtractor
• The subtrcation A – B can be done by taking the 2’s
complement of B and adding it to A because A- B =
A + (-B).
• It means if we use the inveters 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.
• But rather than having separate circuits for
subtraction and addition we can use the Adder-
Subtractor circuit that can be used as adder and
subtrator.
LOGIC MICROOPERATIONS
• Specify binary operations on the strings of bits in registers
– Logic microoperations are bit-wise operations, i.e., they work on
the individual bits of data
– useful for bit manipulations on binary data
– useful for making logical decisions based on the bit value
• For example : the exclusive OR-operation
1010 Content of R1
P : R1  R1  R 2 + 1100 Content of R2
0110 Content of R1 after P=1

• Special Symbols
– Special symbols will be adopted for the logic microoperations
OR(/), AND(), and complement(a bar on top), to distinguish
them from the corresponding symbols used to express Boolean
functions P  Q : R1  R 2  R3, R 4  R5  R6
• the sign + is used as OR when used between Boolean variables
Logic OR and would
Arithmetic ADD mean add when it
Logic Microoperations

LIST OF LOGIC MICROOPERATIONS


 List of Logic Microoperations
- 16 different logic operations with 2 binary vars.
- with n binary variables the number of functions with only two variables where the n variables have 2 n
ways of appearing
 Truth tables for 16 functions of 2 variables and the corresponding 16 logic micro-
operations
x 0011 Boolean Micro-
Name
y 0101 Function Operations
0000 F0 = 0 F0 Clear
0001 F1 = xy FAB AND
0010 F2 = xy' F  A  B’
0011 F3 = x FA Transfer A
0100 F4 = x'y F  A’ B
0101 F5 = y FB Transfer B
0110 F6 = x  y FAB Exclusive-OR
0111 F7 = x + y FAB OR
1000 F8 = (x + y)' F  A  B)’ NOR
1001 F9 = (x  y)' F  (A  B)’ Exclusive-NOR
1010 F10 = y' F  B’ Complement B
1011 F11 = x + y' FAB
1100 F12 = x' F  A’ Complement A
1101 F13 = x' + y F  A’ B
1110 F14 = (xy)' F  (A  B)’ NAND
1111 F15 = 1 F  all 1's Set to all 1's
Shift Microoperations
– Shift Microoperations :
• Shift microoperations are used for serial transfer of data.
• In this operations the content of a register shifts to the right or
the left.
• During a shift –left operation
– The serial input transfers a bit into the right most position
• During a shift –right operation
– The serial input transfers a bit into the left most position

A right shift operation


Serial
input

A left shift operation


Serial
input
• There are three types of shifts
– Logical shift
– Circular shift
– Arithmetic shift
• What differentiates them is the information that goes into
the serial input
LOGICAL SHIFT
• In a logical shift the serial input to the shift is a 0.
• A right logical shift operation:

• A left logical shift operation:

• (Example) Logical shift-left


• 10100011  01000110
• In a Register Transfer Language, the following notation is used
– shl for a logical shift left
– shr for a logical shift right
– Examples:
• R2  shr R2
Shift Microoperations

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:

• A left circular shift operation:

• In a RTL, the following notation is used


– cil for a circular shift left
– cir for a circular shift right
– Examples:
• R2  cir R2
• R3  cil R3

(Example) Circular shift-left


10100011 is shifted to 01000111
ARITHMETIC SHIFT

• An arithmetic shift a microoperation that shifts a signed binary number to the left
or right.
• An arithmetic left shift multiplies a signed number by two
• 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 because the sign of
the number remains the same when multiplied or divided by 2.
• A right arithmetic shift operation:

sign
bit
• A left arithmetic shift operation:

0
sign
bit
Arithmetic Shift Right
• Arithmetic right-shift: Rn-1 remains unchanged;
• Rn-2 receives Rn-1, Rn-3 receives Rn-2, so on.
• For a negative number, 1 is shifted from the sign bit to the
right. A negative number is represented by the 2’s
complement. The sign bit remained unchanged.
Arithmetic Shift Right
• Arithmetic Shift Right :
– Example 1
0100 (4) before the shift
0010 (2) after the shift
– Example 2
1010 (-6) before the shift
1101 (-3) after the shift
• Arithmetic Shift Left :
– Example 1
0010 (2) 
0100 (4)
– Example 2
1110 (-2) 
1100 (-4)

You might also like