Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions...

32
Flip-Flops Basic concepts

Transcript of Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions...

Page 1: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

Flip-Flops

Basic concepts

Page 2: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 2

Flip-Flops A flip-flop is a bi-stable device: a circuit

having 2 stable conditions (0 or 1) 3 classes of flip-flops

latches: outputs respond immediately whileenabled (no timing control)

pulse-triggered flip-flops: outputs responseto the triggering pulse

edge-triggered flip-flops: outputs responsesto the control input edge

Page 3: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 3

Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops have two output Q and Q′ or (Q and

Q) Due to time related characteristic of the flip-

flop, Q and Q′ (or Q) are usually representedas followed: Qt or Q: present state Qt+1 or Q+: next state

Page 4: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 4

4 Types of Flip-FlopsSR flip-flop JK flip-flop

D flip-flop T flip-flop

S R Qt+1 Q’t+1

0 0 Qt Q’t

0 1 0 1

1 0 1 0

1 1 Prohibited

J K Qt+1 Q’t+1

0 0 Qt Q’t

0 1 0 1

1 0 1 0

1 1 Q’t Qt

D Qt+1 Q’t+1

0 0 1

1 1 0

T Qt+1 Q’t+1

0 Qt Q’t

1 Q’t Qt

Page 5: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 5

SR LatchAn SR (or set-reset) latch consists of

S (set) input: set the circuit R (reset) input: reset the circuit Q and Q’ output: output of the SR latch in normal and

complement form

Application example: a switch debouncer

S R Qt+1 Q’t+1

0 0 Qt Q’t

0 1 0 1

1 0 1 0

1 1 Prohibited

Page 6: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 6

SR latch

Page 7: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 7

An application of the SR latch

(a) Effects of contactbounce.

(b) A switchdebouncer.

Page 8: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 8

latch

!

SR

Page 9: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 9

Gated SR latch

(c)

Page 10: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 10

Gated D latch

Page 11: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 11

Timing ConsiderationWhen using a real flip-flop, the following information

is needed to be considered: propagation delay (tpLH, tpHL) - time needed for an

input signal to produce an output signal minimum pulse width (tw(min)) - minimum amount of

time a signal must be applied setup and hold time (tsu, th) - minimum time the

input signal must be held fixed before and after thelatching action

Page 12: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 12

Propagation delays in an SR latch

Page 13: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 13

Timing diagram for an SR latch

Page 14: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 14

Minimum pulse width constraint

Page 15: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 15

Timing diagram for a gated D latch

Page 16: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 16

Unpredictable response in a gated D latch

Page 17: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 17

Master-slave SR flip-flop

Page 18: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 18

Timing diagram for a master-slave SR flip-flop

Page 19: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 19

Master-slave JK flip-flop

Page 20: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 20

Timing diagram for master-slave JK flip-flop

Page 21: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 21

Master-slave D flip-flop

Page 22: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 22

Master-slave T flip-flop

Page 23: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 23

Positive-edge-triggered D flip-flop

Page 24: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 24

Timing diagram for a positive-edge-triggered D flip-flop

Page 25: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 25

Negative-edge-triggered D flip-flop

Page 26: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 26

Asynchronous Inputs do not require the presence of a control

signal preset (PR) - set the flip-flop clear (CLR) - reset the flip-flop

useful to bring a flip-flop to a desiredinitial state

Page 27: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 27

Positive-edge-triggered D flip-flop with asynchronous inputs

Page 28: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 28

Positive-edge-triggered JK flip-flop

Page 29: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 29

Positive-edge-triggered T flip-flop

Page 30: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 30

Master-slave JK flip-flop with data lockout

Page 31: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 31

Characteristic Equations algebraic descriptions of the next-state

table of a flip-flop constructing from the Karnaugh map for

Qt+1 in terms of the present state andinput

Page 32: Flip-Flops - KMUTTwebstaff.kmutt.ac.th/~iauaroen/ENE232/FlipFlop.pdf1/51 A. Yaicharoen 3 Conventions The circuit is set means output = 1 The circuit is reset means output = 0 Flip-flops

1/51 A. Yaicharoen 32

Characteristic equations