Вы находитесь на странице: 1из 41

Engineering 43

Sequential
(FlipFlop) Logic
Bruce Mayer, PE
Licensed Electrical & Mechanical Engineer
BMayer@ChabotCollege.edu
Engineering-43: Engineering Circuit Analysis
1

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

But First WhiteBoard Work


For the Truth Table
Shown at right
Construct the Karnaugh
Map
Write The Minimized
Function Q(A,B,C,D)
Draw the Logic Circuit

Notice 1s in Rows
1, 5, 9, 13, 14, 15
Need only put 1s in these
locations; other cells
Assumed to be Zero
Engineering-43: Engineering Circuit Analysis
2

Row
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

A
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1

B
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1

C
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

D
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1

Q
0
1
0
0
0
1
0
0
0
1
0
0
0
1
1
1

Blank Map (NonStretching)


AB\CD 00

01

11

00

01

11

10

00

ABCD

ABCD

ABCD

ABCD

01

ABCD

ABCD

ABCD

ABCD

11

11

ABCD

ABCD

ABCD

ABCD

10

10

ABCD

ABCD

ABCD

ABCD

00
01

Engineering-43: Engineering Circuit Analysis


3

10 AB\CD

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Stretchable Blank Map

Engineering-43: Engineering Circuit Analysis


4

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

More WhiteBoard Work


Implement This Function using ONLY
NAND Gates

F AC D A B C D A B
An Example of NAND-Gate Synthesis
NANDS are easier to construct than
ANDs, ORs, NORs
NANDs are the preferred gate for logic circuits
Engineering-43: Engineering Circuit Analysis
5

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Memory Filled Logic


The Invert/AND/OR Combinatorial
Logic Circuits depended ONLY on the
Current Inputs; previous states did Not
affect the Current State
Combinatorial Logic is MEMORYLESS

In SEQUENTIAL Logic the Circuit


Output CAN Depend on the Previous
condition of the Circuit
Sequential Logic has MEMORY
Engineering-43: Engineering Circuit Analysis
6

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Sequential Circuit
A sequential circuit
consists of a
feedback path,
and employs
some memory
elements

Combination
al outputs

Combination
al logic

Memory
outputs

Memory
elements

External
inputs

[Sequential circuit] = [Combinational


logic] + [Memory Elements]
Engineering-43: Engineering Circuit Analysis
7

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Synchronous vs Asynchronous
Almost all Logic Chips Include a Clock
The Clock helps to Synchronize the
Operation of the Circuits.
The Clock is simply a very regular Hi/Lo
Pulse train
Logic Forms are divided into two groups:
SYNCHRONUS Depend on Clock
Asynchronous NO Clock-Dependency
Engineering-43: Engineering Circuit Analysis
8

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Asynchronous S-R FlipFlop


Cross-coupled NOR gates
R

R
S

Q
Q'

Similar to inverter pair, with capability to


force Q to 0 (reset=1) or 1 (set=1)
0

R
S

Q'

Engineering-43: Engineering Circuit Analysis


9

n-1
Q

Q'
n-1

1
Bruce Mayer, PE

BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

??

??

Q
Q'

NAND based SR FlipFlop


Cross-coupled NAND gates
S'
R'

S'

R'

Q'

Similar to inverter pair, with capability to


force Q to 0 (reset=0) or 1 (set=0)
NOR notes
Any HI input LO output
Any HI LO

All LO inputs HI output


All LO HI
Engineering-43: Engineering Circuit Analysis
10

NAND notes
Any LO input HI output
Any LO HI

All HI inputs LO output


All HI LO
Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

State Behavior of SR FlipFlop


Transition Table
S
0
0
0
0
1
1
1
1

R
0
0
1
1
0
0
1
1

Qn-1
0
1
0
1
0
1
0
1

Qn
0 hold
1 reset
0
0 set
1 not allowed
1
X
X

characteristic equation
Qn = S + RQn-1
R

Q'

REset

SET

Sequential (output depends on history


when inputs R=0, S=0) but asynchronous
Engineering-43: Engineering Circuit Analysis
11

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

SR FlipFlop Timing Behavior


R

Any HI input LO output


Any HI LO

All LO inputs HI output


Q'

S
Reset

Hold

Set

All LO HI
Reset

Set

Race

100

R
S
Q
Q

Races Produce UnPredictable OutPuts


Engineering-43: Engineering Circuit Analysis
12

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Clocked SR FlipFlop
Control times when
R and S
inputs matter
Otherwise, the slightest glitch on R or S while
enable is low could cause change in value stored
Ensure R & S stable before utilized (to avoid
transient R=1, S=1)

Engineering-43: Engineering Circuit Analysis


13

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Clocked SR FlipFlops
NOR-NOR
Implementation

Truth
Table

R
0
0
1
1
x

S En R S
Qn
0 0 1 1 NotAllowed
1 0 1 0 Reset to 0
0 0 0 1
Set to 1
1 x 0 0
Qn1
x 1 0 0
Qn1
x Dont Care

For NOR: any-HiLO; ALL-LOHi


Engineering-43: Engineering Circuit Analysis
14

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Clocked SR FlipFlops
NAND-NOR
Implementation

Truth
Table

R
0
0
1
1
x

S C
Qn
0 x
Qn1
1 1
Set to 1
0 1 Reset to 0
1 1 NotAllowed
x 0
Qn1
x Dont Care

Engineering-43: Engineering Circuit Analysis


15

Circuit Symbol

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

SR FlipFlop Clock-Overide
Sometimes Need to Set or Reset the
FlipFlop withOUT Regard to the Clock

Note the position of Pr & Cl on the


3rd-Stage ORs (any HiHi)
Ensures Pr & Cl OverRide R, S, & C
Engineering-43: Engineering Circuit Analysis
16

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Edge Triggered D FlipFlop


sensitive to
inputs only
near edge of
clock signal
(not while
steady )

holds D' when


clock goes low

0
R

Clk=1
Q

S
0

Engineering-43: Engineering Circuit Analysis


17

holds D when
clock goes low

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Edge-Triggered FlipFlop Flavors


POSITIVE edge-triggered
Inputs sampled on RISING edge; outputs change
after RISING edge

NEGATIVE edge-triggered flip-flops


Inputs sampled on falling edge; outputs change
after falling edge
100
D
CLK
Qpos
Qpos'
Qneg
Qneg'
Engineering-43: Engineering Circuit Analysis
18

positive edge-triggered FF
negative edge-triggered FF
Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Edge Triggered D FlipFlop


4-NAND,
1-NOT
implementation
Truth Table for
All Postive-Going
Edge D-FFs
NAND:
any LO Hi
All HI LO
Engineering-43: Engineering Circuit Analysis
19

CLK
0
1

D Qn
x Qn1
x Qn1
0 0
1 1
Bruce Mayer, PE

BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Edge Triggered JK FlipFlop


A Toggling Flip Flop
Under A certain Control-Set: Q Q
Notice that Q does NOT go HI-for-sure or
LO-for-sure, and it does NOT remain STEADY

A NAND Nest:
Circuit Symbol

Engineering-43: Engineering Circuit Analysis


20

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

JK FlipFlop Toggle TruthTable


The Simplified Ckt

ReCall NAND
Any LO Hi
ALL Hi LO

Note that the


outputs feed back to
the enabling NAND
gates. This is what
gives the toggling
action when J=K=1
Engineering-43: Engineering Circuit Analysis
21

C
0
1

J
x
x
0
0
1
1

K
x
x
0
1
0
1

Qn
Qn1
Qn1
Qn1
0
1
Qn1

Notes
No Chg
No Chg
No Chg
Reset to 0
Set to 1
TOGGLE

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Cascading FF Shift Register


Serial-in/Parallel-out Shift register
New value goes into first stage
While previous value of 1st stg goes into 2nd stg
The QN can be SAMPLED any time
IN

D Q

Q0

D Q

Q1

OUT

CLK

Engineering-43: Engineering Circuit Analysis


22

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Example: Eliminate Inconsistency


Want to Send Async
SAME
Input
Input Value
to
TWO Places

Clocked
Synchronous
System
D Q

Synchronizer
Q0

Async
Input D Q

Clock

Clock
D Q

Q1

Q0
Q1

Clock

is asynchronous and
fans out to D0 and D1
one FF catches the
signal, one does not
inconsistent state may
be reached!

CLK
Engineering-43: Engineering Circuit Analysis
23

Q1

D Q

Clock

In

Q0

D Q

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

FlipFlops Summarized
Development of D-FF
Level-sensitive used in custom integrated
circuits
can be made with 4 pairs of gates
Usually follows multiphase non-overlapping
clock discipline

Edge-triggered used in programmable logic


devices
Good choice for data storage register

Engineering-43: Engineering Circuit Analysis


24

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

FlipFlops Summarized
Historically J-K FF was popular but now
never used
Similar to R-S but with 1-1 being used to
toggle output (complement state)
Same Operation Can always be
implemented using D FlipFlops

Preset and Clear inputs are highly


desirable on flip-flops
Used at start-up or to reset system to a
known state
Engineering-43: Engineering Circuit Analysis
25

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

FlipFlops Summarized
Reset (set state to 0) R
Synchronous: Dnew = R' Dold
Transition only when next clock edge arrives

Asynchronous: doesn't wait for clock,


quick but dangerous

Preset or Set (set state to 1) S


Synchronous: Dnew = Dold + S
Transition only when next clock edge arrives)

Asynchronous: doesn't wait for clock


quick but dangerous
Engineering-43: Engineering Circuit Analysis
26

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

WhiteBoard Work
Use Gates and a DFF to Implement the
JK-FF operation
C
0
1

Engineering-43: Engineering Circuit Analysis


27

J
x
x
0
0
1
1

K
x
x
0
1
0
1

Qn
Qn1
Qn1
Qn1
0
1
Qn1

Notes
No Chg
No Chg
No Chg
Reset to 0
Set to 1
TOGGLE

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

All Done for Today

IEEE
91-1984
Gates

Engineering-43: Engineering Circuit Analysis


28

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Engineering 43

Appendix
Logic Syn
Bruce Mayer, PE
Licensed Electrical & Mechanical Engineer
BMayer@ChabotCollege.edu
Engineering-43: Engineering Circuit Analysis
29

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Row
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
A
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
B
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
C
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
D
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
Q
0
1
0
0
0
1
0
0
0
1
0
0
0
1
1
1

Engineering-43: Engineering Circuit Analysis


30

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Engineering-43: Engineering Circuit Analysis


31

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

NAND Gate Synthesis


With the expression in SOP form
1. After any need inversions; In the first logic
level there are as many logic gates as
terms in the SOP expression
2. Each gate corresponds to a SINGLE
Term, and has, as inputs, the variables in
that term
3. The outputs of the First Logic-Level are
ALL inputs to a SINGLE (multi-input if
needed) NAND gate
Engineering-43: Engineering Circuit Analysis
32

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Engineering-43: Engineering Circuit Analysis


33

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Engineering-43: Engineering Circuit Analysis


34

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Engineering-43: Engineering Circuit Analysis


35

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Engineering-43: Engineering Circuit Analysis


36

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Engineering-43: Engineering Circuit Analysis


37

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Engineering-43: Engineering Circuit Analysis


38

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Engineering-43: Engineering Circuit Analysis


39

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Engineering-43: Engineering Circuit Analysis


40

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Engineering-43: Engineering Circuit Analysis


41

Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-43_Lec-05c_Thevenin_AC_Power.pptx

Вам также может понравиться