REGISTER TRANSFER AND MICROOPERATIONS2 1.1 Overview of computers and basics of Digital...

Preview:

Citation preview

UNIT-1 REGISTER TRANSFER AND MICROOPERATIONS

1

2

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

SYLLABUS

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

Easy to Program3

BLOCK DIAGRAM OF DIGITAL COMPUTERS

ALU

Control Unit

Input Unit

OutPutUnit

MemoryUnit

• KeyBoard• Mouse

• Monitor• Printer

4

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

Used as a basic block in counters and registers5

1.2 REGISTERS- TRANSFER LANGUAGE

R1

Processor Register R

Numbering of bits

Showing individual bits

Subfields

PC(H) PC(L)

15 8 7 0

• Common ways of drawing the block diagram of a register

7 6 5 4 3 2 1 0

PC

15 0

oDenoted by capital letters oMemory Address Register(MAR)oProgram Counter(PC)oInstruction Register(IR)oProcessor Register(PR)

6

BLOCK DIAGRAM OF REGISTER TRANSFER

Implementation of controlled transfer

P: R2 R1

Block diagram

Timing diagram

Clock

Transfer occurs here

R2

R1

Control Circuit LoadP

n

Clock

Load

t t+1

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 Out8

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

Select

Enable

0123

S0

S1

A0

B0

C0

D0

Bus line for bit 0

• 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 selection value.

13

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] <---R116

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 117

BINARY ADDER

FA

B0 A0

S0

C0FA

B1 A1

S1

C1FA

B2 A2

S2

C2FA

B3 A3

S3

C3

C4

18

BINARY ADDER - SUBTRACTOR

FA

B0 A0

S0

C0C1FA

B1 A1

S1

C2FA

B2 A2

S2

C3FA

B3 A3

S3C4

M

B M O/P

0 0 0

0 1 1

1 0 1

1 1 0

When M=0 the circuit is ADDER.

When M=1 the circuit becomes Subtractor.

19

BINARY INCREMENTER

HA

x y

C S

A0 1

S0

HA

x y

C S

A1

S1

HA

x y

C S

A2

S2

HA

x y

C S

A3

S3C4

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

S1S00123

4x1MUX

X0

Y0

C0

C1

D0FA

S1S00123

4x1MUX

X1

Y1

C1

C2

D1FA

S1S00123

4x1MUX

X2

Y2

C2

C3

D2FA

S1S00123

4x1MUX

X3

Y3

C3

C4

D3FA

Cout

A0

B0

A1

B1

A2

B2

A3

B3

0 1

S0S1Cin

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

1 1 0 1 D = A - 1 Decrement A

1 1 1 1 D = A Transfer A

21

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 ()

Complement/NOT

22

LIST OF LOGIC MICROOPERATIONSBoolean Function Micro operations Logic Function

F0=0 F0 Clear

F1=x FA Transfer A

F2=y FB Transfer B

F3=x.y FA /\ B AND

F4=x+y FA\/ B OR

F5=(xy)’ F A /\ B NAND

F6=(x+y)’ FA\/ B NOR

F7=x y FA B EX-OR

F8= (x y)’ FA B EX-NOR

F9=x’ FA’ Complement A

F10=y’ FB’ Complement B

F11=x.y’ FA /\ B’

F12=x’.y FA ‘/\ B

23

F13=x’+y FA’\/ B

F14=x+y’ FA\/ B’

F15=1 F1 Set to all 1

24

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

1 1 0 0 At

1 0 1 0 B

1 1 1 0 At+1 (A A + B)

APPLICATION OF LOGIC MICRO OPERATION

25

SELECTIVE COMPLEMENT

Complement bits in A where there are

corresponding 1’s in B.

Exclusive OR microoperation can be used For

Selective Complement

1 1 0 0 At

1 0 1 0 B

0 1 1 0 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: AA/\B’

1 1 0 0 At

1 0 1 0 B

0 1 0 0 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

1 0 1 0 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

1 0 1 0 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 0 1 1 0 1 0 1 0

B 0 0 0 0 1 1 1 1 Mask

0 0 0 0 1 0 1 0 After Masking

And then insert a new value

A 0 0 0 0 1 0 1 0 Before

B 1 0 0 1 0 0 0 0 Insert

A 1 0 0 1 1 0 1 0 After Insertion

30

1.7 SHIFT MICROOPERATIONS

There are three types of shifts

Logical shift

Circular shift

Arithmetic shift

Serialinput

• A right shift operation

• A left shift operationSerialinput

31

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:

0

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

R3 cil R3

33

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:

A left arithmetic shift operation:

signbit

signbit

34

1.8 ARITHMETIC LOGIC SHIFT UNIT

35

S3 S2 S1 S0 Cin Operati

on

Function

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’+

1

Subtraction

0 0 1 1 0 F=A-1 Decrement A

0 0 1 1 1 F=A Transfer A

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

36

37

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

Recommended