Lecture 8: Sequential Networks and Finite State Machines
CSE 140: Components and Design Techniques for Digital Systems Spring 2014
CK Cheng, Diba Mirza
- Dept. of Computer Science and Engineering
University of California, San Diego
1
Lecture 8: Sequential Networks and Finite State Machines CSE 140: - - PowerPoint PPT Presentation
Lecture 8: Sequential Networks and Finite State Machines CSE 140: Components and Design Techniques for Digital Systems Spring 2014 CK Cheng, Diba Mirza Dept. of Computer Science and Engineering University of California, San Diego 1
CK Cheng, Diba Mirza
University of California, San Diego
1
2
Combinational
3
4
5
6
7
8
9
10
CLK Q0 Q1
11
CLK
12
13
14
15
00 01 10 11
Q1(t) Q0(t) Q1(t+1) Q0(t+1) 1 1 1 1 1 1 1 1
16
Q1(t) Q0(t) Q1(t+1) Q0(t+1) 1 1 1 1 1 1 1 1
17
Q1(t) Q0(t) Q1(t+1) Q0(t+1) 1 1 1 1 1 1 1 1
Q0(t) Q1(t) Q0(t+1) Q1(t+1) PI Q: What is wrong with the 2-bit counter implementation shown above
edge of the clock signal
18
Q1(t) Q0(t) Q1(t+1) Q0(t+1) 1 1 1 1 1 1 1 1
Q0(t) Q1(t)
D Q Q’ D Q Q’
19
20
Q0(t) Q1(t)
D Q Q’ D Q Q’
x(t) Q0(t) Q1(t)
21
Q0(t) Q1(t)
D Q Q’ D Q Q’
x(t) Q0(t) Q1(t)
22
Q0(t) Q1(t)
D Q Q’ D Q Q’
x(t) Q0(t) Q1(t)
23
0 0 0 1 1 0 1 1
PS
input
x=0 x=1
Q1(t) Q0(t) | (Q1(t+1) Q0(t+1), y(t)) Present State | Next State, Output
S0 S1 S2 S3
PS
input
x=0 x=1
State Assignment
24
0 0 0 1 1 0 1 1
PS
input
x=0 x=1 01, 0 00, 0 10, 0 00, 0 11, 0 00, 0 00, 1 00, 1
Q1(t) Q0(t) | Q1(t+1) Q0(t+1), y(t) Present State | Next State, Output
S0 S1 S2 S3
PS
input
x=0 x=1
S1, 0 S0, 0 S2, 0 S0, 0 S3, 0 S0, 0 S0, 1 S0, 1
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y(t)
CLK x(t) y(t)
S(t) S(t)
38
S1 S0
S2
39
40
41
0 2 6 4 1 3 7 5
x(t) Q1
0 1 - 1 0 0 - 0
Q0
42
D Q Q’ D Q Q’
43
D Q Q’ D Q Q’
Example 3: State Diagram => State Table => Excitation Table => Netlist S1 S0
S2
iClicker: The relation between the above state diagram and sequential circuit.
E. None of the above
44
TA LA TA LB TB TB LA LB
Academic Ave. Bravado Blvd. Dorms Fields Dining Hall Labs
45
TA TB LA LB CLK Reset Traffic Light Controller
46
S0 LA: green LB: red Reset
47
S0 LA: green LB: red S1 LA: yellow LB: red S3 LA: red LB: yellow S2 LA: red LB: green TA TA TB TB Reset
48
49
State Encoding S0 00 S1 01 S2 10 S3 11
50
Output Encoding green 00 yellow 01 red 10
51
S1 S0 S'1 S'0 CLK
state register
Reset r
52
S1 S0 S'1 S'0 CLK
next state logic state register
Reset TA TB
inputs
S1 S0 r
53
S1 S0 S'1 S'0 CLK
next state logic
state register
Reset LA1 LB1 LB0 LA0 TA TB
inputs
S1 S0 r