You are on page 1of 37

UNIT-1 REGISTER TRANSFER

AND
MICROOPERATIONS

1
SYLLABUS

 1.1 Overview of computers and basics of Digital


Electronics-Flip Flops, Registers, Shift registers
 1.2 Register - Transfer-Language

 1.3 Register Transfer

 1.4 Bus Transfer and Memory Transfer

 1.5 Arithmetic Micro-Operations

 Addition, Subtraction, Complements, Negation,


Increment and Decrement
 1.6 Logic micro operations

 1.7 Shift Micro operation.

 1.8 Arithmetic Logic Shift Unit


2
1.1 OVERVIEW OF COMPUTERS AND BASICS OF
DIGITAL ELECTRONICS-FLIP FLOPS,
REGISTERS, SHIFT REGISTERS
 It is an interconnection of digital modules.
 It is a system that manipulates discrete elements of
information that is represented internally in a binary
form.
 Advantages:

 Easy to Design
 Low Cost
 Very Fast Speed
 More Popular with upgrading Technology
 Easy to Function
3
 Easy to Program
BLOCK DIAGRAM OF DIGITAL COMPUTERS

ALU
Input OutPut
Unit Unit
Control
Unit
• KeyBoard • Monitor
• Mouse • Printer

Memory 4

Unit
FLIP FLOP
 It can store 1-bit information.
 It can be designed using NAND or NOR gates.

 It has to stable states: Logic 1 and Logic 0

 Types Of Flip Flop

 RS Flip Flop

 D Flip Flop

 T Flip Flop

 JK Flip Flop

 Master Slave JK Flip Flop

 Application Of Flip Flop

 Used as a memory element

 Used as a delay element 5


 Used as a basic block in counters and registers
1.2 REGISTERS- TRANSFER LANGUAGE
oDenoted by capital letters
oMemory Address Register(MAR)
oProgram Counter(PC)
oInstruction Register(IR)
oProcessor Register(PR)

• Common ways of drawing the block diagram of a


register
Processor Register R
Showing individual bits

R1 7 6 5 4 3 2 1 0
15 0 15 8 7 0
PC PC(H) PC(L)

Numbering of bits Subfields

6
BLOCK DIAGRAM OF REGISTER TRANSFER
Implementation of controlled transfer
P: R2 R1

Control
P Load Clock
Block diagram Circuit R2

R1
t t+1
Timing diagram Clock

Load
Transfer occurs here

7
1.3 REGISTER AND SHIFT REGISTER
 To increase the storage capacity, we use a group of
flip flops. This group of flip flop is known as a
Register.

 Shift Register is used for storage and transfer of


digital data.
 Types of Shift Register

 Serial IN Serial Out

 Serial In Parallel Out

 Parallel In Serial Out

 Parallel In Parallel Out


8
1.4 BUS AND MEMORY TRANSFER
o Bus is a path(of a group of wires) over which
information is transferred, from any of several
sources to any of several destinations.

o 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.

o Control signal determine which register is selected by


the bus.

9
BUS AND BUS TRANSFER (USING MULTIPLEXERS)

10
CONTINUE…

Function Table
S1 S0 Register Selected
0 0 A
0 1 B
1 0 C
1 1 D

11
THREE-STATE BUS BUFFERS

Three state gate is digital circuit that exhibits three


states. Logic 1,Logic 0 and High Impedance state.

12
USING TRI STATE BUFFER GATES

Bus line with three-state buffers

Bus line for bit 0


A0
B0
C0
D0

Select S0 0
1
S1 2
Enable 3

• When the enable input of the decoder is 0, all


of its four outputs are 0, bus line is in high
impedance state.

• When the enable input of the decoder is 1,one of


the four buffer will be active, depending on the 13
selection value.
BUS LINE WITH THREE-STATE BUFFERS

Function Table

S1 S0 Register Selected

0 0 Tri State buffer gates for Register A Enable

0 1 Tri State buffer gates for Register B Enable

1 0 Tri State buffer gates for Register C Enable

1 1 Tri State buffer gates for Register D Enable

14
MEMORY TRANSFER
 Two Types of transfer operation
 Memory Read
 Memory Write

 Address Register(AR) : Memory Unit that


receives the address from register
 Data Register(DR): Data are transferred to
register.

15
MEMORY TRANSFER
 Memory Read
The transfer of information into DR from
the Memory Word M selected by the address AR.

Read: DR <---- M[AR]

 Memory Write
The transfer of New information to be
stored into the memory is called a write operation.

Write: M[AR] <---R1


16
1.5 ARITHMETIC MICRO OPERATIONS
 The operations executed on data stored in
registers.
 Example: Shift,Load,Clear,Increment

 R3  R1+ R2 (ADD)
 R3  R1 –R2 (Sub)

 R2 R2’ (1’s complement of R2)

 R2 R2’ + 1 (2’s complement of R2)

 R3  R1+ R2’ +1 (Subtraction)

 R1  R1 +1 Increment by 1

 R1  R1 -1 Decrement by 1
17
BINARY ADDER

B3 A3 B2 A2 B1 A1 B0 A0

FA C3 FA C2 FA C1 FA C0

C4 S3 S2 S1 S0

18
BINARY ADDER - SUBTRACTOR
B3 A3 B2 A2 B1 A1 B0 A0

C3 C2 C1 C0
FA FA FA FA

C4 S3 S2 S1 S0

B M O/P
When M=0 the circuit is ADDER.
0
0 0

0 1 1 When M=1 the circuit becomes


Subtractor.
1
0 1
19
1 1 0
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

One of the inputs to the least Significant Half Adder


is connected to Logic 1and other input is connected to
the LSB of the number to be incremented.

20
ARITHMETIC CIRCUIT
Cin
S1
S0
A0 X0 C0
S1 D0
S0 FA
B0 0 4x1 Y0 C1
1 MUX
2
3
A1 X1 C1
S1 FA D1
S0
B1 0 4x1 Y1 C2
1 MUX
2
3
A2 X2 C2
S1 FA D2
S0
B2 0 4x1 Y2 C3
1 MUX
2
3
A3 X3 C3
S1 FA D3
S0
B3 0 4x1 Y3 C4
1 MUX
2
3 Cout
0 1

S1 S0 Cin Y Output Microoperation


0 0 0 B D=A+B Add
0 0 1 B D=A+B+1 Add with carry
0 1 0 B’ D = A + B’ Subtract with borrow
0 1 1 B’ D = A + B’+ 1 Subtract
1 0 0 0 D=A Transfer A
1 0 1 0 D=A+1 Increment A 21
1 1 0 1 D=A-1 Decrement A
1 1 1 1 D=A Transfer A
1.6 LOGIC MICROOPERATIONS
 Specify binary operations on the strings of bits in
registers
o Logic microoperations are bit-wise operations, i.e.,
they work on the individual bits of data
o useful for bit manipulations on binary data
o useful for making logical decisions based on the
bit value
 16 different logic functions that can be defined over
two binary input variables
 most systems only implement four of these

 AND ()
 OR (),
 XOR () 22

 Complement/NOT
LIST OF LOGIC MICROOPERATIONS
Boolean Function Micro operations Logic Function
F0=0 F0 Clear
F1=x FA Transfer A
F2=y FB Transfer B
F3=x.y FA /\ B AND
F4=x+y FA\/ B OR
F5=(xy)’ F A /\ B NAND
F6=(x+y)’ FA\/ B NOR
F7=x y FA B EX-OR
F8= (x y)’ FA B EX-NOR
F9=x’ FA’ Complement A
F10=y’ FB’ Complement B
FA /\ B’
23
F11=x.y’
F12=x’.y FA ‘/\ B
F13=x’+y FA’\/ B
F14=x+y’ FA\/ B’
F15=1 F1 Set to all 1

24
APPLICATION OF LOGIC MICRO OPERATION
SELECTIVE SET

 Operation set to 1 bits in register A where there


are corresponding 1’s in register B.
 The OR- Micro operation can be used to
selectively set bits of a register

1100 At
1010 B
1110 At+1 (A  A + B)

25
SELECTIVE COMPLEMENT

 Complement bits in A where there are


corresponding 1’s in B.
 Exclusive OR microoperation can be used For
Selective Complement

1100 At
1010 B
0110 At+1 (A  A  B)

26
SELECTIVE CLEAR

 Clear to 0 in bits of A where there are


corresponding 1’s in B.
 Logic Micro operation is: AA/\B’

1100 At
1010 B
0100 At+1 (A  A  B’)

27
MASK OPERATION

 It is similar to selective CLEAR except that the bits


of A are cleared only where there are corresponding
0’s in B

1 1 0 0 At
1010 B
1 0 0 0 At+1 (A  A  B)

28
CLEAR OPERATION

 It compares the words in A and B and if two


numbers are equal then produces 0’s.

1 0 1 0 At
1010 B
0 0 0 0 At+1

29
INSERT OPERATION
 Insert operation inserts a new value into a group of
bits.
 This is done by first masking the bits and then
Oring them with the required value.
 Example

A 0110 1010
B 0000 1111 Mask
0000 1010 After Masking

And then insert a new value


A 0000 1010 Before
B 1001 0000 Insert 30

A 1001 1010 After Insertion


1.7 SHIFT MICROOPERATIONS
 There are three types of shifts
 Logical shift
 Circular shift
 Arithmetic shift

• A right shift operation


Serial
input

Serial
• A left shift operation input

31
LOGICAL SHIFT
 In a logical shift the serial input to the shift is a
0.
A right logical shift operation:
0

A left logical shift operation:


0

32
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
33

 R3  cil R3
ARITHMETIC SHIFT
 An arithmetic shift is meant for signed binary
numbers
 An arithmetic left shift multiplies a signed number
by two
 An arithmetic right shift divides a signed number by
two
 A right arithmetic shift operation:
sign
bit

 A left arithmetic
sign
bit shift operation:

34
1.8 ARITHMETIC LOGIC SHIFT UNIT

35
S3 S2 S1 S0 Cin Operati Function
on
0 0 0 0 0 F=A Transfer A
0 0 0 0 1 F=A+1 Increment A
0 0 0 1 0 F=A+B Addition
0 0 0 1 1 F=A+B+1 Addition with
Carry
0 0 1 0 0 F=A+B’ Subtraction with
borrow
0 0 1 0 1 F=A+B’+ Subtraction
1
0 0 1 1 0 F=A-1 Decrement A
0 0 1 1 1 F=A Transfer A 36

0 1 0 0 -- F=A /\B AND


0 1 0 1 -- F=A\/ B OR
0 1 1 0 -- F=AB EX-OR
0 1 1 1 -- F=A’ COMPLE
MENT A
1 0 -- -- -- F=shr A Shift
Right
1 1 -- -- -- F= shl A Shift Left

37

You might also like