5
1 ECE 274 - Digital Logic Lecture 5 Lecture 5 Introduction - Sequential Logic Design Storing One Bit SR Latch D flip-flop 2 Digital Design Sequential Logic Design – Controllers: Bit Storage Bit Storage Call Cancel button button Blue light Flight-attendant call-button system. Pressing Call turns on the light, which stays on after Call is released. Pressing Cancel turns off the light. 3 Digital Design Sequential Logic Design -- Controllers : Bit Storage Q S First (failed) attempt at using feedback to store a bit. 4 Digital Design Sequential Logic Design -- Controllers : Bit Storage Q S t 0 0 0 S Q 1 0 t 1 0 1 0 (a) Tracing the behavior of our first attempt at bit storage. Q S t 0 0 0 S Q 1 0 t 1 0 Q S t 1 0 0 1 0 (a) (b) Q S t 0 0 0 S Q 1 0 t 1 0 Q S t 1 0 0 Q S t 1 0 1 1 0 (a) (b) (c) Q S t 0 0 0 S Q 1 0 t 1 0 Q S t 1 0 0 Q S t 1 0 1 Q S t 1 1 1 1 0 (a) (b) (c) (d) Q stays 1 forever Q S t 0 0 0 S Q 1 0 t 1 0 Q S t 1 0 0 Q S t 1 0 1 Q S t 1 1 1 1 0 Q S t 0 1 1 (a) (b) (c) (d) (e) Q stays 1 forever 5 Digital Design Sequential Logic Design -- Controllers : Bit Storage Q S (set) R (reset) SR latch Basic SR latch 2 cross-coupled NOR gates 2 inputs: Set & Reset 2 outputs: Q’ and Q Feedback loop 6 Digital Design Sequential Logic Design -- Controllers : Bit Storage Q S= 0 R= 1 0 0 1 1 t S R t Q 1 0 1 0 1 0 1 0 SR latch when S=0 and R=1. Q(next) = 0

Lecture 5

Embed Size (px)

DESCRIPTION

RANGDIG

Citation preview

Page 1: Lecture 5

1

ECE 274 - Digital LogicLecture 5

Lecture 5Introduction - Sequential Logic DesignStoring One Bit

SR LatchD flip-flop

2

Digital DesignSequential Logic Design – Controllers: Bit Storage

BitStorage

Call

Cancelbutton

button

Bluelight

Flight-attendant call-button system. Pressing Call turns on the light, which stays on after Call is released. Pressing Cancel turns off the light.

3

Digital DesignSequential Logic Design -- Controllers : Bit Storage

QS

First (failed) attempt at using feedback to store a bit.

4

Digital DesignSequential Logic Design -- Controllers : Bit Storage

QS

t

00 0

S

Q 10

t10

QS

t

10 0 QS

t

10

1 QS

t

11

1

10

QS

t

01

1(a) (b) (c) (d) (e)

Q stays 1 forever

Tracing the behavior of our first attempt at bit storage.

QS

t

00 0

S

Q 10

t10

QS

t

10 0 QS

t

10

1 QS

t

11

1

10

QS

t

01

1(a) (b) (c) (d) (e)

Q stays 1 forever

QS

t

00 0

S

Q 10

t10

QS

t

10 0 QS

t

10

1 QS

t

11

1

10

QS

t

01

1(a) (b) (c) (d) (e)

Q stays 1 forever

QS

t

00 0

S

Q 10

t10

QS

t

10 0 QS

t

10

1 QS

t

11

1

10

QS

t

01

1(a) (b) (c) (d) (e)

Q stays 1 forever

QS

t

00 0

S

Q 10

t10

QS

t

10 0 QS

t

10

1 QS

t

11

1

10

QS

t

01

1(a) (b) (c) (d) (e)

Q stays 1 forever

5

Digital DesignSequential Logic Design -- Controllers : Bit Storage

Q

S (set)

R (reset)

SR latchBasic SR latch2 cross-coupled NOR gates2 inputs: Set & Reset2 outputs: Q’ and QFeedback loop

6

Digital DesignSequential Logic Design -- Controllers : Bit Storage

Q

S=0

R =1

0

0 1

1

t SR

t

Q

10101010

SR latch when S=0 and R=1.Q(next) = 0

Page 2: Lecture 5

7

Digital DesignSequential Logic Design -- Controllers : Bit Storage

Q

S=0

R =0

0

0 1

1

t SR

t

Q

10101010

SR latch when S=0 and R=0.Q(next) = Q

8

Digital DesignSequential Logic Design -- Controllers : Bit Storage

Q

S=1

R =0

1

1 0

0

t SR

t

Q

10101010

SR latch when S=1 and R=0.Q(next) = 1

9

Digital DesignSequential Logic Design -- Controllers : Bit Storage

Figure 3.9

Flight attendant call-button system using a basic SR latch.

10

Digital DesignSequential Logic Design -- Controllers : Bit Storage

What happens when you Set (S=1) & Reset (R=1) at the same time?

S=1 and R=1 causes problems –Q oscillates when SR return to 00.

11

Digital DesignSequential Logic Design -- Controllers : Bit Storage

Q eventually settles to either 0 or 1, due to race condition.

12

Digital DesignSequential Logic Design -- Controllers : Bit Storage

Possible Solution:Introduce circuitry to prevent S=R=1

0.2 ns

0.8 ns

Will it Work?

Reality: NOT ALWAYS… due to the delay of the inverter and AND gate.

Conceptually: YES … S and R can’t both be 1 in this sample circuit.

Page 3: Lecture 5

13

Digital DesignSequential Logic Design -- Controllers : Bit Storage

1 ns

Glitches: Temporary values on signals caused by gate delays.

Gate Delays: can cause S=R=1.

14

Digital DesignSequential Logic Design -- Controllers : Bit Storage

Level-sensitive SR latch = SR latch + enable input C.

S1 = 0 S1 = 0

S1 = S S1 = S

C1

0

15

Digital DesignSequential Logic Design -- Controllers

Level-sensitive SR latch -- an SR latch with enable input C.

16

Digital DesignSequential Design – Controllers: Synchronous Circuits

MHz, GHz -> speeds of a processorTime is measured by clocksA clock is used to co-ordinate & synchronize events;

Clock cycle time

Related to datapath cycle time

1 cycle

Rising edge Falling edge

Clock = 1

Clock = 0

17

Digital DesignSequential Design – Controllers: Synchronous Circuits

Figure 3.17

Timing Input Changes:Circuit inputs (i.e. S & R) should only change while Clk=0, such that latch inputs will be stable when Clk=1.

18

Digital DesignSequential Logic Design – Controllers: Bit Storage

But How Do We Prevent S=R=1 once & for all?!?!?(caveat: assumes you are using C responsibly)

Make a D (data)-Latch

Page 4: Lecture 5

19

Digital DesignSequential Logic Design – Controllers: Bit Storage

20

Digital DesignSequential Logic Design – Controllers: D-Latch

D latch symbol

21

Digital DesignSequential Logic Design – Controllers: Registers

A problem with latches – through how many latches will Y propagate for each pulse of Clk_A? For Clk_B?

What the heck?!?!?

22

Digital DesignSequential Design – Controllers: Latch: Signal Propagation

23

Digital DesignSequential Design – Controllers: Bit Storage: Flip-Flop

24

Digital DesignSequential Logic Design – Controllers: Bit Storage

D Q

Clk !Q

D Q

Clk !Q

Latch Flip-Flop

Page 5: Lecture 5

25

Digital DesignSequential Logic Design – Controllers: Bit Storage

Through how many flip-flops will Y propagate for each pulse of Clk_A? For Clk_B?

Not AGAIN?!?!?

One flip-flop exactly per pulse, for either clock signal.

26

Digital DesignSequential Logic Design -- Controllers

Positive (shown on the left) and negative (right) edge-triggered D flip-flops. The sideways triangle input represents an edge-triggered clock

input.

27

Digital DesignSequential Logic Design – Controllers: Bit Storage

Latch versus Flip-Flop Timing

28

Digital DesignSequential Logic Design – Controllers: Flight Call System

D Truth Table for call-button system

/Q(next)

29

Digital DesignSequential Logic Design -- Controllers: Flight Call System

Flight attendant call-button system:

(a) block diagram

(b) implemented using a D flip-flop.

30

Digital DesignSequential Logic Design – Controllers: Bit Storage

Increasingly-better bit storage blocks, leading to the D flip-flop