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

Register Transfer and Microoperations Guide

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

Register Transfer and Microoperations Guide

Lecture notes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Chapter 4:

Register Transfer and Microoperations


(4.1, 4.2, 4.4, 4.5)

1
contents

• Register Transfer Language

• Register Transfer

• Arithmetic Microoperations

• Logic Microoperations

cpe 252: Computer Organization 2


4-1 Register Transfer Language
cont.

• Microoperations: operations executed on data


stored in one or more registers.
• For any function of the computer, a sequence of
microoperations is used to describe it
• The result of the operation may be:
– replace the previous binary information of a
register or
– transferred to another register
Shift Right Operation
101101110011 010110111001

cpe 252: Computer Organization 3


4-1 Register Transfer Language
cont.

• Register Transfer Language (RTL) : a


symbolic notation to describe the microoperation
transfers among registers
Next steps:
– Define symbols for various types of microoperations,
– Describe the hardware that implements these
microoperations

cpe 252: Computer Organization 4


4-2 Register Transfer (our first
microoperation)

• Computer registers are designated by


capital letters (sometimes followed by
numerals) to denote the function of the
register
• R1: processor register
• MAR: Memory Address Register (holds an address
for a memory unit)
• PC: Program Counter
• IR: Instruction Register
• SR: Status Register
cpe 252: Computer Organization 5
4-2 Register Transfer cont.
• The individual flip-flops in an n-bit register
are numbered in sequence from 0 to n-1
(from the right position toward the left
position)

R1 7 6 5 4 3 2 1 0

Register R1 Showing individual bits

A block diagram of a register

cpe 252: Computer Organization 6


4-2 Register Transfer cont.
Other ways of drawing the block diagram of a register:

15 0
PC

Numbering of bits

15 87 0
Upper byte PC(H) PC(L) Lower byte

Partitioned into two parts

cpe 252: Computer Organization 7


4-2 Register Transfer cont.
• Information transfer from one register to another is
described by a replacement operator: R2 ← R1
• This statement denotes a transfer of the content of
register R1 into register R2
• The transfer happens in one clock cycle
• The content of the R1 (source) does not change
• The content of the R2 (destination) will be lost and
replaced by the new data transferred from R1
• We are assuming that the circuits are available from the
outputs of the source register to the inputs of the
destination register, and that the destination register has
a parallel load capability

cpe 252: Computer Organization 8


4-2 Register Transfer cont.
• Conditional transfer occurs only under a
control condition

• Representation of a (conditional) transfer


P: R2 ← R1
• A binary condition (P equals to 0 or 1)
determines when the transfer occurs
• The content of R1 is transferred into R2
only if P is 1

cpe 252: Computer Organization 9


4-2 Register Transfer cont.
Hardware implementation of a controlled transfer: P: R2 ← R1
Block diagram: Control P Load
R2 Clock
Circuit

R1

t t+1

Timing diagram
Clock
Synchronized
Load
with the clock
Transfer occurs here

cpe 252: Computer Organization 10


4-2 Register Transfer cont.

Basic Symbols for Register Transfers


Symbol Description Examples
Letters & Denotes a register MAR, R2
numerals
Parenthesis ( ) Denotes a part of a R2(0-7), R2(L)
register
Arrow ← Denotes transfer of R2 ← R1
information
Comma , Separates two R2 ← R1, R1 ← R2
microoperations
cpe 252: Computer Organization 11
4-4 Arithmetic Microoperations
• The microoperations most often
encountered in digital computers are
classified into four categories:
– Register transfer microoperations
– Arithmetic microoperations (on numeric data
stored in the registers)
– Logic microoperations (bit manipulations on
non-numeric data)
– Shift microoperations
cpe 252: Computer Organization 13
4-4 Arithmetic Microoperations cont.
• The basic arithmetic microoperations are:
addition, subtraction, increment,
decrement, and shift
• Addition Microoperation:
R3 ←R1+R2
• Subtraction Microoperation:
R3 ←R1-R2 or : 1’s complement

R3 ←R1+R2+1
cpe 252: Computer Organization 14
4-4 Arithmetic Microoperations cont.
• One’s Complement Microoperation:
R2 ←R2
• Two’s Complement Microoperation:
R2 ←R2+1
• Increment Microoperation:
R2 ←R2+1
• Decrement Microoperation:
R2 ←R2-1
cpe 252: Computer Organization 15
4-4 Arithmetic Microoperations
Binary Adder

B3 A3 B2 A2 B1 A1 B0 A0

C3 C2 C1
FA FA FA FA C0

C4 S3 S2 S1 S0

4-bit binary adder


(connection of FAs)

cpe 252: Computer Organization 16


4-4 Arithmetic Microoperations
Binary Adder-Subtractor
B3 A3 B2 A2 B1 A1 B0 A0

C3 C2 C1 C0
FA FA FA FA

C4 S3 S2 S1 S0

4-bit adder-subtractor

cpe 252: Computer Organization 17


4-4 Arithmetic Microoperations
Binary Adder-Subtractor
• If M=0, It works as an adder and if M=1, then
• For unsigned numbers, this gives A – B if A≥B

18
4-4 Arithmetic Microoperations
Binary Incrementer
A3 A2 A1 A0 1

x y x y x y x y

HA HA HA HA

C S C S C S C S

C4 S3 S2 S1 S0

4-bit Binary Incrementer

cpe 252: Computer Organization 20


4-5 Logic Microoperations
The four basic microoperations
cont.
AND Microoperation
• Symbol: 

• Gate:

• Example: 1001102  10101102 = 00001102

cpe 252: Computer Organization 21


4-5 Logic Microoperations
The four basic microoperations
cont.
Complement (NOT) Microoperation
• Symbol:

• Gate:

• Example: 10101102 = 01010012

cpe 252: Computer Organization 22


4-5 Logic Microoperations
The four basic microoperations
cont.
XOR (Exclusive-OR) Microoperation
• Symbol: 

• Gate:

• Example: 1001102  10101102 =


11100002

cpe 252: Computer Organization 23


Logic Microoperations

APPLICATIONS OF LOGIC MICROOPERATIONS


• Logic microoperations can be used to manipulate individual bits
or a portions of a word in a register

• Consider the data in a register A. In another register, B, is bit


data that will be used to modify the contents of A

– Selective-set AA+B
– Selective-complement AAB
– Selective-clear A  A • B’
– Mask (Delete) AA•B
– Clear AAB
– Insert A  (A • B) + C
– Compare AAB
4-5 Logic Microoperations
Other Logic Microoperations
Selective-set Operation
• Selective-set AA+B

• The selective set operation sets to 1 the bits in register A


where there are corresponding 1’s in register B.

• Example: 01002  10002 = 11002


A-register B-register

cpe 252: Computer Organization 25


4-5 Logic Microoperations
Other Logic Microoperations cont.
Selective-complement (toggling) Operation
Selective-complement A  A  B

• Used to force selected bits of a register to be


complemented by using the XOR operation
• (It complements bits in A where there are corresponding 1’s in B. It does not effect bit positions
that have 0’s in B)

• Example: 00012  10002 = 10012

cpe 252: Computer Organization 26


• Selective-clear A  A • B’
• The selective clear operation clears to 0 in
A where there are corresponding 1’s in B.

cpe 252: Computer Organization 27


4-5 Logic Microoperations
Other Logic Microoperations cont.
Insert Operation
Insert A  (A • B) + C
• Step1: mask the desired bits
• Step2: OR them with the desired value

• Example: suppose R1 = 0110 1010, and we


desire to replace the leftmost 4 bits (0110) with
1001 then:
– Step1: 0110 1010  0000 1111
– Step2: 0000 1010  1001 0000
•  R1 = 1001 1010cpe 252: Computer Organization 28
4-5 Logic Microoperations
Other Logic Microoperations
cont.
NAND Microoperation

• Symbols:  and

• Gate:

• Example: 1001102  10101102 = 11110012

cpe 252: Computer Organization 29


4-5 Logic Microoperations
Other Logic Microoperations
cont.
NOR Microoperation

• Symbols:  and

• Gate:

• Example: 1001102  10101102 = 00010012

cpe 252: Computer Organization 30


4-5 Logic Microoperations
Other Logic Microoperations
cont.
Set (Preset) Microoperation
• Force all bits into 1’s by ORing them with a value
in which all its bits are being assigned to logic-1
• Example: 1001102  1111112 = 1111112
Clear (Reset) Microoperation
• Force all bits into 0’s by ANDing them with a
value in which all its bits are being assigned to
logic-0
• Example: 1001102  0000002 = 0000002

cpe 252: Computer Organization 31

You might also like