Chap.
13:
Analysis of Clocked
Sequential Circuits
1
Deal
Deal with
with Sequential
Sequential circuits
circuits which
which have
have inputs
inputs
13 - 1 Sequential Parity Checker
Parity bit : odd parity even parity
0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1
1 0 0 1 1 0 1 1 1 0 0 1 1 0 1 0
X synchronous with Clock,
X Parity Z
(Data Input) Checker Input number of 1 odd ⇒ Z = 1
even ⇒ Z = 0
Clock
X 1 0 0 1 1 0 1 0
Clock
Z=Q
2
2 states required S0 : even number of 1 received
S1 : odd number of 1 received
X=1
Construct S0 S1
state
Z=0 Z =1
graph
X=0 X=0
X=1
State Table
Present
Present Next state Output Q+ T
state X=0 X=1 Z Q X=0 X=1 X=0 X=1 Z
S0 S0 S1 0 0 0 1 0 1 0
S1 S1 S0 1 1 1 0 0 1 1
3
Use T-F/F to implement
Q+ T X
Q X=0 X=1 X=0 X=1 Z Q 0 1
0 0 1 0 1 0 0 0 1
1 1 0 0 1 1 1 0 1
T
Z T=X
T-F/F
Clock X
4
Use D-F/F to implement
Q+ D X 0 1
Q X=0 X=1 X=0 X=1 Z Q Q
0 0 1 0 1 0 0 0 1 0 0
1 1 0 1 0 1 1 1 0 1 1
D Z
Z D = QX + Q X Z=Q
Q Q
D
Clock
X 5
13-2 Analysis
13-2 Analysis by
by Signal
Signal Tracing
Tracing
and
and Timing
Timing Charts
Charts
Ⅰ. Moore Machine : Outputs are function of the present state only.
State determined ⇒ Output determined
Ex : S1
Q Z Z=0
F/Fs
S3 S2
Z =1 Z =1
Outputs are state variables.
Outputs are associated with states.
6
Ⅱ. Mealy Machine :
Outputs are functions of both the present states and the input .
Ex :
Combinational
network S1
1 1
0 1
0
1
F/Fs
S3 S2
0
1
7
Analysis of Moore Machine : Output changes only after the clock pulse.
A , B initial state : 0 , 0 (reset)
X = 0 1 1 0 1
A = 0 1 0 1 0 1
B = 0 0 1 1 1 1
Z = (0) 1 1 0 1 0
8
Analysis of Mealy Mac hine : Output changes only after the clock pulse.
Z = XB'+ XA + X' A' B
A , B initial state : 0 , 0 (reset)
X = 1 0 1 0 1
A = 0 0 0 1 1 0
B = 0 1 1 1 1 0
Z = 1(0) 1 0(1) 0 1
9
13-3 State
13-3 State Tables
Tables and
and Graphs
Graphs
Example:
Construct state tables and graphs from logic circuits.
Moore
Moore machine
machine
1. Determine the F/F input equation
& the circuit output equation
D A = X ⊕ B' D B = X + B
Z = A⊕B
10
2. Derive the next-state equations
A + = D A = X ⊕ B'
B+ = D B = X + A
3. Plot a next-state map
X X
AB 0 1 AB 0 1
00 1 0 00 0 1
01 0 1 01 0 1
11 0 1 11 1 1
10 1 0 10 1 1
A+ B+
11
4. Combine all next-state maps to form the state table
A+B+ Present Next state Present
AB X=0 X=1 Z state X=0 X=1 Output (Z)
00 10 01 0 S 0 S 3 S 1 0
01 00 11 1 S 1 S 0 S 2 1
11 01 11 0 S 2 S 1 S 2 0
10 11 01 1 S 3 S 3 S 1 0
5. Corresponding state graph (Moore)
X X
AB 0 1 AB 0 1
00 1 0 00 0 1
01 0 1 01 0 1
11 0 1 11 1 1
10 1 0 10 1 1
A+ B+ 12
6. Construction of timing chart
Present Next state A , B initial state : 0 , 0 (reset)
Present
state X=0 X=1 Output (Z)
X = 0 1 1 0 1
S 0 00 S 3 S 1 0
A = 0 1 0 1 0 1
S 1 01 S 0 S 2 1 B = 0 0 1 1 1 1
S 2
11 S 1 S 2 0 Z = (0) 1 1 0 1 0
S 3
10 S 2 S 1 1 Output changes only after the clock pulse.
13
Analysis of Moore Machine
0 0
01 00
A , B initial state : 0 , 0 (reset)
X = 0 1 1 0 1
A = 0 1 0 1 0 1
B = 0 0 1 1 1 1
Z = (0) 1 1 0 1 0
14
Analysis of Moore Machine
1 0
11 11
A , B initial state : 0 , 0 (reset)
X = 0 1 1 0 1
A = 0 1 0 1 0 1
B = 0 0 1 1 1 1
Z = (0) 1 1 0 1 0
15
Analysis of Moore Machine
0 1
10 01
A , B initial state : 0 , 0 (reset)
X = 0 1 1 0 1
A = 0 1 0 1 0 1
B = 0 0 1 1 1 1
Z = (0) 1 1 0 1 0
16
Mealy
Mealy machine
machine
1. Determine the F/F input equation
& the circuit output equation
JA = XB , KA = X
Z = X' A' B + XB'+ XA
JB = X , KB = XA
2. Derive the next-state equations
A + = J A A'+ K A ' A = XBA'+ X' A
B + = J B B'+ K B ' B = XB'+ (A' X' )B = XB'+ X' B + A' B 17
3. Plot a next-state map
X X X
AB 0 1 AB 0 1 AB 0 1
00 0 0 00 0 1 00 0 1
01 0 1 01 1 1 01 1 0
11 1 0 11 1 0 11 0 1
10 1 0 10 0 1 10 0 1
A+ B+ Z
4. Combine all next-state maps to form the state table
Present
A+B+ Z Present Next state Output (Z)
AB X=0 X=1 X=0 X=1 state X=0 X=1 X=0 X=1
00 00 01 0 1 S 0 S 0 S 1 0 1
01 01 11 1 0 S 1 S 1 S 2 1 0
11 11 00 0 1 S 2 S 2 S 0 0 1
10 10 01 0 1 S 3 S 3 S 1 0 1
18
5. Corresponding state graph (Mealy)
0/0
Present
S0 Present Next state Output (Z)
0/0
1/1 1/1
state X=0 X=1 X=0 X=1
S 0 S 0 S 1 0 1
1/1 S3 S 1 S 1 S 2 1 0
S 2 S 2 S 0 0 1
0/0 S2 S1
S 3 S 3 S 1 0 1
1/0 0/1
19
6. Construction of timing chart
A A B B X
B'
K J K J
X
Z
A
X CK CK X X'
A'
B
X B X A
X = 10101
A = 0 0 0 11 0
B = 0 1111 0
Z = 1 (0) 1 0 (1) 0 1
Due to Due to
B change 20
X change
Analysis of Mealy Machine
110 X 100
11 00 10 01
10 B 101
11 X 00
A A B B 00 Z
A
K J K J 001 X
11 A
1 01 0 1 001
01 B
X CK CK X
Glitch Spikes
1 01 1 0
X B X A
X = 10101
A = 0 0 0 11 0
B = 0 1111 0
Z = 1 (0) 1 0 (1) 0 1 Due to Due to
B change X change 21
Analysis of Mealy Machine
1 X 0
1 0 0 1
0 B 0
1 X 0
A A B B 0 Z
A
K J K J 0 X
1 A
1 1 0 1 0
1 B
X CK CK X
Glitch Spikes
1 1 1 0
X B X A
X = 10101
A = 0 0 0 11 0
B = 0 1111 0
Z = 1 (0) 1 0 (1) 0 1 Due to Due to
B change X change 22
Analysis of Mealy Machine
1 X 0
10 01 0 1
0 B 01
1 X 01
A A B B 01 Z
A
K J K J 0 X
10 A
1 1 01 1 0
1 B
X CK CK X
Glitch Spikes
1 1 1 01
X B X A
X = 10101
A = 0 0 0 11 0
B = 0 1111 0
Z = 1 (0) 1 0 (1) 0 1 Due to Due to
B change X change 23
Analysis of Mealy Machine
1 0 X 0
10 01 0 1
0 B 01 0
1 0 X 01 0
A A B B 01 Z
A
K J K J 0 1 X
10 A
10 1 0 10 1 0
1 B
X CK CK X
Glitch Spikes
1 1 10 01
X B X A
X = 10101
A = 0 0 0 11 0
B = 0 1111 0
Z = 1 (0) 1 0 (1) 0 1 Due to Due to
B change X change 24
A two - input , two - output example
Present Next state Present output (Z1Z2)
state x1x2 = 00 01 10 11 x1x2 = 00 01 10 11
S0 S3 S2 S1 S0 00 10 11 01
S1 S0 S1 S2 S3 10 10 11 11
S2 S3 S0 S1 S1 00 10 11 01
S3 S2 S2 S1 S0 00 00 01 01
25
Construction and Interpretation of Timing Charts
1. When constructing timing charts, note that a state change can
only occur after the rising (or falling) edge of the clock.
2. The input will normally be stable immediately before and after the
active clock edge.
3. For a Moore circuit, the output can change only when the state
changes, but for a Mealy circuit, the output can change when
the input changes as well as when the state changes.
4. False outputs are difficult to determine from the state graph, so
use either signal tracing through the circuit or use the state table
when constructing timing charts for Mealy circuits.
26
Construction and Interpretation of Timing Charts
5. When using a Mealy state table for constructing,
(a) For the first input, read the present output and plot it.
(b) Read the next state and plot it (following the active edge of the clock)
(c) Go to the row in the table which corresponds to the next state and
read the output under the old input column and plot it. (false output??)
(d) Change to the next input and repeat steps (a), (b), and (c)
6. For Mealy circuits, the best time to read the output is just before
the active edge of the clock, because the output should always
be correct at that time.
27
13 -4 General
13-4 General Models
Models for
for Sequential
Sequential Circuits
Circuits
For a Moore machine
Z 1 = f 1 (Q 1 L Q k )
M
Z n = f n (Q 1 L Q k )
Q 1+ = g 1 (X 1 L X m , Q 1 L Q k )
M
Q +k = g k (X 1 L X m , Q 1 L Q k )
1.當Q1+ LQk+ settled as clock goes rising
or falling edge。
2.當Q1 LQk 穩定後,Z1 LZn 即穩定
⇒ 無Spurious output
28
For a Mealy machine : D F/Fs are used
Z1 = f 1 (X1 L X m , Q1 LQ k )
M
Z n = f n (X1 L X m , Q1 LQ k )
Q1+ = D1 = g 1 (X1 L X m , Q1 LQ k )
M
Q +k = D k = g k (X1 L X m , Q1 LQ k )
當X1 L X m 改變,Q1 LQ K 還在Previous state
或當Q1 LQ K 已改變,但X1 L X m change to
new inputs時,可能有 false output 出現。
29
Present Next state Present output (Z1Z2)
state X = 0 1 2 3 X = 0 1 2 3
S0 S3 S2 S1 S0 0 2 3 1
S1 S0 S1 S2 S3 2 2 3 3 ← coding of
S2 S3 S0 S1 S1 0 2 3 1 outputs
S3 S2 S2 S1 S0 0 0 1 1
A state table specifies two functions
• next state function S+ = δ (S , X )
• present output function Z = λ (S , X )
From the above table
δ(S0 , 1) = S2 δ(S0 , 3) = S0
λ (S0 , 1) = 2 λ (S2 , 3) = 1 30
Q For J - K F/F : JA , KA independent of QA 又 Q + = JQ'+ K' Q
⇒ Q = 0 時 Q+ = J Q = 1 時 Q + = K'
Next state map : Q +A Q +B Q C+
QA QA
↓ ↓
Q QA QA
QB QC A QB QC JB map QB QC
0 1 0 1 0 1
00 1 1 00 1 1 00 1 1
B=0 C=0
01 × × 01 × × 01 × × C=1
JC map
11 0 0 11 0 0 11 0 0 K'C map
B=1
10 0 × 10 0 × 10 0 ×
JA map K'A map K'B map
JB=1 KB=1 Jc=B’ Kc=1
JA = B' KA = B or C
31
A A A
BC 0 1 BC 0 1 BC 0 1
00 1 1 00 0 1 00 1 1
01 1 × 01 1 1 01 1 × ??????
11 0 0 11 0 1 11 0 0
10 0 0 10 1 × 10 0 0
A+ B+ C+
000
A A A 011 100
BC 0 1 BC 0 1 BC 0 1
00 1 00 1 00 1
010 111
01 1 01 1 1 01 1
11 1 11 1 11 1 1
10 1 10 1 10 1 1 101 001
TA TB TC 110
32
HOMEWORK
HOMEWORK --
-- Unit
Unit 13
13
• 13.3
• 13.7
• 13.13
• 13.17
33