Sequential Circuits
Sequential Circuits
and
Latches
A B
Qa Qb
Qa
Qb
(Qa = 0)
1
R
0
1
S
0
1
Qa ?
0
1
Qb ?
0
Time
Qa = 0
Qb = 1
R = 1 → Qa = 0
S = 0 & Qa = 0 → Qb = 1
Latch is reset.
5/21/2011 Digital Systems - Verilog Course Team 13
SR Latch
(Qa = 1)
1
R
0
1
S
0
1
Qa ?
0
1
Qb ?
0
Time
Qa = 1
Qb = 0
S = 1 → Qb = 0
R = 0 & Qb = 0 → Qa = 1
Latch is set.
5/21/2011 Digital Systems - Verilog Course Team 15
SR Latch
(Qa+ = Qa)
1
R
0
1
S
0
1
Qa ?
0
1
Qa = 0 Qb ?
0
Time
Qa = 0 Qb = 1
S = 0 & Qa = 0 → Qb = 1
Latch stores the
R = 0 & Qb = 1 → Qa = 0 value of Qa
1
R
0
1
S
0
1
Qa ?
0
1
Qb ?
0
Time
Qa = 1 Qa = 1
Qb = 0
S = 0 & Qa = 1 → Qb = 0
Latch stores the
R = 0 & Qb = 0 → Qa = 1 value of Qa
(Qa = Qb = 0)
1
R
0
1
S
0
1
Qa ?
0
1
Qb ?
0
Time
Qa = 0
Qb = 0
S = 1 → Qb = 0; R = 1 → Qa = 0
1
R
0
1
S
0
1
Qa ?
0
1
Qb ?
0
Time
Qa = 0
Qb = 0
S = 1 → Qb = 0; R = 1 → Qa = 0
(S = 1 → 0 & R = 1 → 0)
1
S
0
1
Qa ?
0
1
Qb ?
0
Time
Qa = ?
Qb = ?
R
Qa
Qb
S
R
Qa
Qb
S
S'
R'
S
S'
R R'
Clk
Q Q Q
Master-Slave Flip-Flop
Clock
positive edge
negative edge
D Q Qc
Negative Edge-triggered
Q Qc D Flip-Flop
(a) Circuit
Clock
Qa Gated D Latch
Qb + Edge-triggered D FF
Qc - Edge-triggered D FF
D
Q
Clock
Clear
(a) Circuit
master slave
Preset
D Q
Clear
JK Flip-Flop
T Flip-Flop
4-bit Register
Q3 Q2 Q1 Q0
D Q D Q D Q D Q
2-to-1
Multiplexer Q Q Q Q
Serial Clock
input Shift/Load Parallel input
000
111 001
110 010
101 011
100
(Ripple Counters)
Clock
A0
A1
A2
A3
Count 0 1 2 3 4 5 6 7 8
Clock
Q0
Q1
Q2
Q3
Count 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1
D Q Q2
D Q Q3
Q
Output
Clock carry
0 Q1
D1 1 D Q
Q
0 Q2
D2 1 D Q
Q
0 Q3
D3 1 D Q
Q
Is the Load signal
active-high or active-low? Output
carry
Load
Clock
Modulo-6 Counter
1 Enable
0 D0 Q0
3-bit counter
0 D1 Q1
with Parallel Load
0 D2 Q2
Counter resets to zero
Load
when count reaches six.
Clock
Clock
Clock
Q0
Q1
Q2
Count 0 1 2 3 4 5 0 1
Clock Q Q Q
Clock
Q0
Q1
Q2
Count 0 1 2 3 4 5 0 1 2
(Modulo-10 Counter)
Asynchronous
Counter
Synchronous
Counter
Up / Down Counter
A
Input
C B
State
Output
Input
5/21/2011 Digital Systems - Verilog Course Team 108
Finite State Machine Analysis
input
state
output
What type of
FSM is this?
state
input
What type of
FSM is this?
5/21/2011 Digital Systems - Verilog Course Team 118
FSM Analysis: Example (JK FF)
input
output
state
What type of
FSM is this?
FSM Design
• Moore Machines
Input: 011101011011101…
Output: 000100000000100…
State
Diagram
QA QB QA+ QB+
State Table
5/21/2011 Digital Systems - Verilog Course Team 133
FSM Design: Example (Moore)
The choice of Flip-Flop determines the complexity of the
combinational logic required in the design of the state machine.
Each type of Flip-Flop has a unique characteristic equation.
SR Flip-Flop JK Flip-Flop
− Q+ = S + R'.Q − Q+ = J.Q' + K'.Q
D Flip-Flop T Flip-Flop
− Q+ = D − Q+ = T '.Q + T.Q'
• (Q+ = D)
Q+ = D
next state flip-flop input
5/21/2011 Digital Systems - Verilog Course Team 136
FSM Design: Example (Moore)
QA
QB
Q'B
Excitation Table
QA QB QA+ QB+
Q+ = J.Q' + K'.Q
next state flip-flop inputs
5/21/2011 Digital Systems - Verilog Course Team 141
FSM Design: Example (Moore)
QA
Q'A
QB
Q'B
2. All changes in the circuit occur on the positive edge of the clock.
Input (w): 0 0 0 1 0 1 0 1 1 0 1 1 0 1 1 …
Output (z): 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 …
State
Diagram
End State
2. All changes in the circuit occur on the positive edge of the clock.
Input (w): 0 0 0 1 0 1 0 1 1 0 1 1 0 1 1 …
Output (z): 0 0 0 0 0 1 0 1 0 0 1 0 0 1 0 …
State
Diagram
End State
2. All changes in the circuit occur on the positive edge of the clock.
Input (w): 0 1 0 0 1 1 0 1 0 1 1 1 0 1 1 …
Output (z): 0 0 1 0 0 0 1 0 1 0 0 0 1 0 0 …
State
Diagram
State Assignment
And
State Minimization
Input: 011101011011101…
Output: 001100001001100…
w = 1
w = 0 AS⁄0z/=00 BS⁄ 1z /= 00
w = 0
w = 0 w = 1
CS⁄ 2z /=11
State
Diagram
w = 1
State Table
Characteristic Equation: D = Q+
Y2 y2
DA = w.(QA + QB) D Q zz
A
Q z = QA
Y1 y1
w
w D Q
DB = w.QA'.QB' B
Q
Clock
Resetn
Characteristic Equation: D = Q+
Y1 y1
DB = w w D Q
B
Clock Q
Resetn
DB = w.QC D Q
B
Q
DC = w.' w D Q
C
Clock Q
Resetn
Definition:
Two states Si and Sj are said to be equivalent if and only if for
every possible input sequence, the same output sequence will be
produced regardless of whether Si or Sj is the initial state.
Definition:
Example:
B/1 C/0
State
Diagram
D/1 E/0
G/0 F/0
A B C 1
B D F 1
C F E 0
D B G 1
E F C 0
F E D 0
G F G 0
Initial Partition:
P1 = (ABCDEFG)
The initial partition contains all states in the state diagram / table.
A B C 1
B D F 1
C F E 0
D B G 1
E F C 0
F E D 0
G F G 0
ABD CEFG
0 1 0 1
− P3 = (ABD)(CEG)(F)
unique state
ABD CEG
0 1 0 1
− P4 = (AD)(CEG)(F)(B)
unique states
AD CEG
0 1 0 1
BB CG FFF ECG
− P5 = (AD)(CEG)(F)(B)
A B C 1
B A F 1
C F C 0
F C A 0
Minimized
State Diagram
1. data
2. application programs
3. operating system
address data
10-bit address
1024 locations
Write Cycle
Read Cycle