02 SequentialCircuits
02 SequentialCircuits
Sub-topic
Outline
• Classical Automata
• Flip-flops
• Latches
• Sequential Circuit Design
Sequential Circuits
Delay Memory
line
Clock
Classical Automata
Finite State Machines (FSMs)
input X
(clock) Internal state S output Z
Output Function
Classical Automata
Example
- X = {e} S0 e=1 S1
- Z = {0,1,2,3} 0 1
- S = {S0,S1,S2,S3} e=1
-Initial state = S0 e=1
State Diagram:
S3 S2
3 e=1 2
Sequential Circuits as FSM
S
Q
Q
S Q
Q
R
R
t SR S R Qt+Δt Qt+Δt
311 0 0 0 0
210 0 1 1 0 Set
101 Reset
1 0 0 1
000 1 1 Q Qt
t Hold
S-R Latch
t SR S R Qt+Δt Qt+Δt R
311 0 0 1 1 Weird!!
210 0 1 1 0 Set
Reset
101
000
1
1
0
1
0
Q Qt
t
1
Hold Preserve Q
a.k.a. Hold Q
S-R Latch
90%
10%
D-Latch
Enable D S R Q Q
0 0 1 1 Q Q
0 1 1 1 Q Q
1 0 1 0 0 1
1 1 0 1 1 0
S
D
Q
Q
δ R
Enable
D-Latch
Enable D S R Q Q
0 0 1 1 Q Q
0 1 1 1 Q Q
1 0 1 0 0 1
1 1 0 1 1 0
1
Enable
0
1
D 0
1
S 0
1
R 0
Hold 1
Q 0
Latch 1 Latch 2
D1
D D Q D Q Q
Master Slave
Enab. Enab. Q
CLK
EN1 EN2
Master-Slave D Flop-Flop Latch 1
D1
Latch 2
D D
Master
Q D
Slave
Q Q
Enab. Enab. Q
CLK EN1 EN2
1
D Din* Input data D may change
0
1
CLK 0
1
EN1 Latch 1 is Latch 1 is Holding Latch 1 is Transparent
Transparent 0
1
D1 D1 = Din* Changed input data D enter Latch 1
0
1
EN2 Latch 2 is Holding Latch 2 is Transparent Latch 2 is Holding
0
1
Q Q = D1 = Din* 0
The state of the flip-flop’s output Q copies input Positive-Edge-Triggered
D when the positive edge of the clock CLK occurs D Flip-Flop
Master-Slave D Flop-Flop
D=1
Dn Qn Qn+1 Qn Qn+1 Dn
D Q
0 0 1 1 0 0 0 0 0 0
CLK
0 Q 0 1 0 0 1 1
STATE DIAGRAM
1 0 1 1 0 0
BLOCK
DIAGRAM 1 1 1 1 1 1
TIME Qn+1 = Dn Dn = Qn+1
DIAGRAM Setup Hold There
the
is a timing "window" around the clocking moment during which
input must remain stable and unchanged in order to be recognized.
time time
D Din* Input data D may change
1
CLK 0
Propagation
time 1
Q Q = Din*
0
T Flip-Flop
Positive-Edge -Triggered
T Flip-Flop (rising edge)
T Q
CLK
Q
0 T=1 0
0 1
T=1
T Flip-Flop
T Q
Tn Qn Qn+1 Qn Qn+1 Tn
CLK
0 0 0 0 0 0
Q
0 1 1 0 1 1
1 0 1 1 0 1
0 T=1 0 1 1 0 1 1 0
0 1
T=1 Q n1 Q n T Q n T
Sequential Circuits
Sn+1 = δ(Sn,Xn)
Sequential Circuits
Sm-1
xp-1
… … … …
zq-1
S0
S0
x0
z0
Synchronous Sequential Circuits as FSM
Register
Next state s(n)
State
x(n) δ m
z(n)
p present
s(n+1) λ
state q
Present input
clk
Synchronous Sequential Circuits as FSM
Register
Next state s(n) z(n)
State
x(n) δ λ
p m present q
s(n+1)
Present input state
clk
Sequential Circuits Analysis
Logic Diagram
Sequential Circuits Analysis
Logic Diagram
Sequential Circuits Analysis
D S Q Given: D-Latch
En D Qt+Δt
δ State Diagram
Enable
R 0 x Qt or Characteristic
1 0 0 Table
1 1 1
D-Latch Specs
En D Qt+Δt
SR Excitation Table
Qt Qt+Δt St Rt 0 x Qt
respects SR=0
0 0 0 x 1 0 0
1 1 1
0 1 1 0
State table of Sequential
1 0 0 1 Circuit to be Designed
1 1 x 0
En D Qt Qt+Δt S R
0 0 0 0 0 x
0 0 1 1 x 0
0 1 0 0 0 x
0 1 1 1 x 0
1 0 0 0 0 x
1 0 1 0 0 1
1 1 0 1 1 0
1 1 1 1 x 0
Excitation table for
Sequential Circuit to be Designed
Sequential Circuits Design Example
5. Find simplified equations
S En D Qt Qt+Δt S R
En DQt 00 01 11 10 0 0 0 0 0 x
0 0 1 1 x 0
0 0 0 x1 x3 0 2
0 1 0 0 0 x
1 0 4 0 5 x7 1 6 0 1 1 1 x 0
En.D 1 0 0 0 0 x
R
1 0 1 0 0 1
En DQt 00 01 11 10
1 1 0 1 1 0
0 x 0 0 1 0 3 x2 1 1 1 1 x 0
1 x4 1 5 0 7 06
En.D
Sequential Circuits Design Example
6. Build the circuit
D S Q
S = En.D
R = En.D
Enable R
S = En.D
R = En.D
D Q
S
En Q
R
39
Sequential Circuits Design Example2
JK-FF Specs
SR Excitation Table
Qt Qt+Δt St Rt 0 0 0 x
respects SR=0
0 0 0 x
0 1 1 x
0 1 1 0
1 0 0 1
1 0 x 1
1 1 x 0 1 1 x 0
J K Qt Qt+Δt S R
0 0 0 0 0 x
0 0 1 1 x 0
0 1 0 0 0 x
0 1 1 0 0 1
1 0 0 1 1 0
1 0 1 1 x 0
1 1 0 1 1 0
1 1 1 0 0 1
Excitation table for
Sequential Circuit to be Designed
Sequential Circuits Design Example2
5. Find simplified equations
J KQt 00 01 11 10 J K Qt Qt+Δt S R
0 0 0 0 0 x
S= JQ’ 0 0 0 x 1 0 3 0*2
0 0 1 1 x 0
1 14 x 5 07 1 6
0 1 0 0 0 x
J KQt 00 01 11 10 0 1 1 0 0 1
R= KQ
1 0 0 1 1 0
0 x 0 0 1 13 x 2
1 0 1 1 x 0
1 0 4 0*5 17 0 6 1 1 0 1 1 0
1 1 1 0 0 1
Sequential Circuits Design Example2
6. Build the circuit
S= JQ’
R= KQ
Sequential Circuits Design Example3
00
NOTE:
x=0 The states are
01 11
already encoded,
so the Transition Table
will be derived directly from
10 the state diagram. Hence, after Step 1
will go directly to Step 3.
x=0
Sequential Circuits Design Example3
4. Excitation Table
Present Next State
State Sn In Sn+1
x=0
A B x A+ B+
00 0 0 0 0 0
0 0 1
x=0
01 11 0 1 0
0 1 1
1 0 0
10
1 0 1
x=0 1 1 0
1 1 1
Sequential Circuits Design Example3
4. Excitation Table
Present Next State
State Sn In Sn+1
x=0
A B x A+ B+
00
00 0 0 0 0 0
0 0 1
x=0
01 11 0 1 0
0 1 1
1 0 0
10
1 0 1
x=0 1 1 0
1 1 1
Sequential Circuits Design Example3
4. Excitation Table
Present Next State
State Sn In Sn+1
x=0
A B x A+ B+
00
00 0 0 0 0 0
0 0 1 0 1
x=0
01 11 0 1 0
0 1 1
1 0 0
10
1 0 1
x=0 1 1 0
1 1 1
Sequential Circuits Design Example3
4. Excitation Table
Present Next State
State Sn In Sn+1
x=0
A B x A+ B+
00
00 0 0 0 0 0
0 0 1 0 1
x=0
01 11 0 1 0 0 0
0 1 1 1 0
1 0 0 1 0
10
1 0 1 1 1
x=0 1 1 0 1 1
1 1 1 0 0
Sequential Circuits Design Example3
4. Excitation Table – using 2 JK-FF
JB = x x 1 x x 1 0
x
KB = x+A’
Sequential Circuits Design Example3
6. Build the circuit
JA = Bx
KA = Bx x
A
JB = x JA =KA
KB = x+A’
JB B
KB
A’
Sequential Circuits Design Example4
Clk
Present state Sn Next state Sn +1
Example4 Q3 Q2 Q1 Q0 Q3+ Q2+ Q1+ Q0+
0 0 0 0 1 0 0 0
0 0 0 1 0 0 0 0
• Design a 4 bit counter 0 0 1 0 0 0 1 1
2. State Diagram, 0 0 1 1 0 0 0 1
3. State Assignment 0 1 0 0 x x x x
0 1 0 1 x x x x
0 1 1 0 0 0 1 0
State Diagram
0 1 1 1 x x x x
1 0 0 0 1 1 0 0
Reset 0000 1000 1100 1101 1 0 0 1 x x x x
1 0 1 0 x x x x
0001 1111
1 0 1 1 x x x x
D 1 0 0 0 1 1 0 0 x 0 1 x 0 x 0 x
1 0 0 1 x x x x x x x x x x x x
e
1 0 1 0 x x x x x x x x x x x x
s
1 0 1 1 x x x x x x x x x x x x
i
1 1 0 0 1 1 0 1 x 0 x 0 0 x 1 x
g 1 1 0 1 1 1 1 1 x 0 x 0 1 x x 0
n 1 1 1 0 0 1 1 0 x 1 x 0 x 0 0 x
55 1 1 1 1 1 1 1 0 x 0 x 0 x 0 x 1
Sequential Circuits Design Example4
J 1 Q3 Q0 K1 Q3 Q0 J 0 Q2 Q1 K 0 Q3 Q1
Sequential Circuits Desi Example4
J 3 Q1 Q0
K 3 Q1 Q0
J 2 Q3
K 2 Q3
J 1 Q3 Q0
K1 Q3 Q0
J 0 Q2 Q1
K 0 Q3 Q1