Registers Page 1. Page 2 What is a Register? A Register is a collection of flip-flops with some...

29
Registers Page 1

Transcript of Registers Page 1. Page 2 What is a Register? A Register is a collection of flip-flops with some...

Page 1: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

Registers

Page 1

Page 2: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

Page 2

What is a Register?

A Register is a collection of flip-flops with some common function or characteristic Control signals - common clock, clear, load, etc. Function - part of multi-bit storage, counter, or

shift register

At a minimum, we must be able to: Observe the stored binary value Change the stored binary value

Page 3: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

3

Clocked sequential circuits a group of flip-flops and combinational gates connected to form a feedback path

Flip-flops + Combinational gates(essential) (optional)

Register: a group of flip-flops gates that determine how the information is transferred

into the register Counter:

a register that goes through a predetermined sequence of states

Page 4: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

4

Registers

A n-bit register n flip-flops capable of

storing n bits of binary information

4-bit register

D

C

R

D

C

R

D

C

R

D

C

R

I0

I1

I2

I3

A0

A1

A2

A3

ClockReset

Page 5: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

Page 5

Kinds of RegistersStorage Register

Group of storage elements read/written as a unit

4-bit register constructed from 4 D FFsShared clock and clear lines

TTL 74171 Quad D-type FF with Clear(Small numbers represent pin #s on package)

Schematic Shape

Q1

CLR

D3D2D1D0

171

Q1

Q0Q0

CLK Q3Q3Q2Q2

11

109

5

67

43

2

14

13

151

12

V+

D3

D2

D1

D0

CLR

CLK

Q3

Q3F

Q2

Q2F

Q1

Q1F

Q0

Q0F

D Q

C Q

D Q

C Q

D Q

C Q

D Q

C Q

Page 6: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

Page 6

Kinds of Registers

Input/Output Variations Selective Load CapabilityTri-state or Open Collector OutputsTrue and Complementary Outputs

74377 Octal D-type FFswith input enable

74374 Octal D-type FFswith output enable

EN enabled low and lo-to-hi clock transition to load new

data into register

OE asserted low presents FF state to output pins; otherwise

high impedence

HGFEDCBA

QHQGQFQEQDQCQBQA

OE

37411

1

3478

13141718

256912151619

CLK

D3

D6Q5

Q2

377

Q1Q0

Q3

EN CLK

Q6

Q4

Q7

D5

D2D1D0

D4

D7

1

3478

13141718

11

256912151619

Page 7: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

Page 7

Kinds of Registers

We will be discussing the 7400 register series which is a rather popular series of registers.

74ls373: This register is made up of 8 latches and to have a clock enable the following structure is used:

1D

1D

1D

1D

1D

1D

1D

1D

Ls373

C1

en

1D

C1

D7

Q7…. 1D

C1

D0

Q0

en

z7 z0

Page 8: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

Page 8

Kinds of Registers

When the enable signal is high although clocking is done, the values of the latches won’t appear on the output lines. The following figure shows us how this enable line can be used to select which one of the numerous registers’ value is to be set on the output bus:

1D

AC1

en

88

1D

BC1

en

88

sel A

sel B

bus

System clk

bus

01234567

0 1 2 3 4 5 6 7

Page 9: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

Page 9

Kinds of Registers 74ls374: This package is very similar to that of the

74ls373. The only particular difference is that here we are allowed to feeding of outputs through combinational logic back into the register and this is because we have flip flops instead of latches in the 74ls373:

1D

1D

1D

1D

1D

1D

1D

1D

Ls374

C1

en

Page 10: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

10

4-bit register with parallel load

load'

load

Page 11: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

11

Shift Registers

Shift register a register capable of shifting its binary

information in one or both directions

Simplest shift register

11

01 1

01

10

1

Page 12: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

Page 12

Kinds of Registers

Shift Registers

Storage + ability to circulate data among storage elements

Shift from left storage element to right neighbor on every lo-to-hi transition on shift signal

Wrap around from rightmost element to leftmost element

Shift DirectionReset

ResetShift

CLK CLK CLK CLK

Vcc

Vcc

J Q

K Q

J Q

K Q

J Q

K Q

J Q

K Q

Q1 Q2 Q3 Q4

Q 1 1

0

0

0

Q 2 0

1

0

0

Q 3 0

0

1

0

Q 4 0

0

0

1

Shift

Shift

Shift

Page 13: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

13

Serial transfer vs. Parallel transfer

Serial transfer Information is transferred one bit at a time shifts the bits out of the source register into the

destination register

Parallel transfer:All the bits of the register are transferred at the same

time

Page 14: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

14

Example: Serial transfer from reg A to reg B

Page 15: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

15

Serial addition using D flip-flops

0101

0011

1

1 0

0

1

1

0

1

0

1

Page 16: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

16

Serial adder using JK flip-flops

JQ = x y

KQ = x y = (x + y)

S = x y Q

Page 17: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

17

Circuit diagram

JQ = x y

KQ = x y = (x + y)

S = x y Q

Ci

Page 18: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

Page 18

Kinds of Registers

Register Files

Two dimensional array of flip-flopsAddress used as index to a particular wordWord contents read or written

74670 4x4 Register File withTri-state Outputs

Separate Read and Write EnablesSeparate Read and Write AddressData Input, Q Outputs

Contains 16 D-ffs, organized asfour rows (words) of four elements (bits)

670

Q4

D1

D4D3D2

Q3Q2Q1

WE

WAWB

RE

RARB

54

11

1413

12

15123

10976

Page 19: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

Page 19

Serial Data Transfer

Serial transfer moves data bits from A to B one bit per clock Rx and Tx have single wire between the two. For ‘n’ bit registers, it takes ‘n’ clocks for data move

Reg. A

1 bitsignal

Usual implementation is with a shift register.

Reg. B

clock

Page 20: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

Page 20

Serial Data Transfer Typical serial transfer is a multi-step process

Load transmit shift register with data to send Shift data bit by bit from transmit to receive SR Transfer received data to other registers

The transmit SR must have parallel load AKA parallel to serial shift register

The receive SR must have parallel outputs AKA serial to parallel shift register

Other control/timing signals usually needed

Page 21: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

Page 21

Serial Data Transfer

Reg. A (P to S)

1 bit signal(serial data)

Reg. B (S to P)

clock

Parallel Transmit

Data

Parallel Receive

Data

‘n’ bits

‘n’ bits

load

SL

Page 22: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

Page 22

Serial Data Transfer

Serial data transfer used where data rate is relatively slow and/or parallel bit transfer channels are expensive PC serial port and USB interfaces wireless/fiber optic data transmissions

Cell phonesWireless networksSatellite telephone/TV

Page 23: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

Page 23

Typical Multi-Function Shift Register

Shift Register I/OSerial vs. Parallel InputsSerial vs. Parallel OutputsShift Direction: Left vs. Right

74194 4-bit UniversalShift Register

Serial Inputs: LSI, RSIParallel Inputs: D, C, B, AParallel Outputs: QD, QC, QB, QAClear SignalPositive Edge Triggered Devices

S1,S0 determine the shift functionS1 = 1, S0 = 1: Load on rising clk edge synchronous loadS1 = 1, S0 = 0: shift left on rising clk edge LSI replaces element DS1 = 0, S0 = 1: shift right on rising clk edge RSI replaces element AS1 = 0, S0 = 0: hold state

Multiplexing logic on input to each FF!

Shifters well suited for serial-to-parallel conversions, such as terminal to computer communications

S1S0

LSI

ABCD

RSI

CLK

CLR

QAQBQCQD

Page 24: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

Page 24

Serial Transfer with Shift Registers

Shift Register Application: Parallel to Serial Conversion

QAQBQCQD

S1S0LSIDCBA

RSICLK

CLR

QAQBQCQD

S1S0LSIDCBA

RSICLK

CLR

D7D6D5D4

Sender

D3D2D1D0

QAQBQCQD

S1S0LSIDCBA

RSICLK

CLR

QAQBQCQD

S1S0LSIDCBA

RSICLK

CLR

Receiver

D7D6D5D4

D3D2D1D0

Clock

194 194

194194

ParallelInputs

Serialtransmission

ParallelOutputs

Page 25: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

25

Universal Shift Register

Unidirectional shift register

Bidirectional shift register

Universal shift register:has both direction shifts & parallel load/out

capabilities

Page 26: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

26

Capability of a universal shift register:1. A clear control to clear the register to 0.

2. A clock input to synchronize the operations.

3. A shift-right control to enable the shift right operation and the serial input and output lines associated w/ the shift right.

4. A shift-left control to enable the shift left operation and the serial input and output lines associated w/ the shift left.

5. A parallel-load control to enable a parallel transfer and the n parallel input lines associated w/ the parallel transfer.

6. n parallel output lines.

7. A control state that leaves the information in the register unchanged in the presence of the clock.

Page 27: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

27

Example: 4-bit universal shift registerParallel outputsA3 A2 A1 A0

I3 I2 I1 I0

Parallel inputs

4-bit universalshift register

Clears1

s2

Serial input forshift-right

Serial input forshift-left

CLK

Page 28: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

28

Function table

Clear s1 s0 A3+ A2

+ A1+ A0

+ (operation)

0 × × 0 0 0 0 Clear

1 0 0 A3 A2 A1 A0 No change

1 0 1 sri A3 A2 A1 Shift right

1 1 0 A2 A1 A0 sli Shift left

1 1 1 I3 I2 I1 I0 Parallel load

Page 29: Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.

29

4-bit universal shift register

A1A2

A0