Lecture 9: Sequential Networks: Implementation
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 9: Sequential Networks: Implementation CSE 140: Components - - PowerPoint PPT Presentation
Lecture 9: Sequential Networks: Implementation 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 Implementation
CK Cheng, Diba Mirza
University of California, San Diego
1
2
3
C1 C2
CLK x(t) y(t)
Mealy Machine C1 C2
CLK x(t) y(t)
Moore Machine
S(t) S(t)
4
Preparing for tomorrow according to our effort today
CLK x(t) y(t)
Q(t)
5
6
x(t) Q(t)
CLK
id x(t) Q(t) Q(t+1) 1 1 1 1 2 1 3 1 1
7
x(t) Q(t)
CLK
Q(t)
id x(t) Q(t) T(t) Q(t+1) 1 1 1 1 1 1 2 1 1 3 1 1 1 id x(t) Q(t) Q(t+1) 1 1 1 1 2 1 1 3 1 1
T(t)
8
x(t) Q(t)
CLK
Q(t)
id x(t) Q(t) T(t) Q(t+1) 1 1 1 1 1 1 2 1 1 3 1 1 1
9
10
11
00 1 01 10 1 1 11 1 1 Q(t) Q(t+1) JK
0-
1 1-
1 PS NS Q(t) Q(t+1) JK
If Q(t) is 1, and Q(t+1) is 0, then JK needs to be -1.
12
0- 01 1 10
1 PS NS Q(t) Q(t+1)
1 1 1 1 PS NS Q(t) Q(t+1)
00 1 01 1 PS SR Q(t) Q(t+1)
10 1 1 11
1 1 1 PS T Q(t) Q(t+1)
13
0-
1 1-
1 PS NS Q(t) Q(t+1)
1 1 1 1 PS NS Q(t) Q(t+1)
00 1 01 1 PS JK Q(t) Q(t+1)
10 1 1 11 1 1 1 1 1 PS D Q(t) Q(t+1)
14
15
00 1 01 1 PS JK Q(t)
10 1 1 11 1
Q Q’ C1 J K T
16
Q
id 1 2 3 4 5 6 7 J(t) 1 1 1 1 K(t) 1 1 1 1 Q(t) 1 1 1 1 Q(t+1) 1 1 1 1 T(t) 1 1 1 1 1 1 1 1 PS NS Q(t) Q(t+1)
T
17
0 2 6 4 1 3 7 5
Q(t)
J
0 0 1 1 0 1 1 0
K
Q Q’ J K T
18
19
20
S0 S1 S2 S3
PS
Next state
S1 S2 S3 S0 State Table
S0 S1 S2 S3
21
S0 S1 S2 S3
S1 S2 S3 S0 State Table
S0 S1 S2 S3
State Table with Assigned Encoding
0 0 0 1 1 0 1 1
Current
01 10 11 00
Next
22
id Q1(t) Q0(t) T1(t) T0(t) Q1(t+1) Q0(t+1) 1 1 1 1 2 1 1 1 3 1 1
Excitation table
23
id Q1(t) Q0(t) T1(t) T0(t) Q1(t+1) Q0(t+1) 1 1 1 1 1 1 1 2 1 1 1 1 3 1 1 1 1
Excitation table
24
id Q1(t) Q0(t) T1(t) T0(t) Q1(t+1) Q0(t+1) 1 1 1 1 1 1 1 2 1 1 1 1 3 1 1 1 1
Excitation table
Q1(t+1) = T1(t) Q’1(t)+T’1(t)Q1(t)
25
id Q1(t) Q0(t) T1(t) T0(t) Q1(t+1) Q0(t+1) 1 1 1 1 1 1 1 2 1 1 1 1 3 1 1 1 1
Excitation table
26
T Q Q’ T Q Q’
Q0 Q1 1 T1
27
Assign mapping a:0, b:1
28
Assign mapping a:0, b:1 PI Q How many states should the pattern recognizer have A. One because it has one output B. One because it has one input C. Two because the input can be one of two states (a or b) D. Three because . .. . . . . E. Four because . . . . .
29
PI Q: How many states should the pattern recognizer have A. One because it has one output B. One because it has one input C. Two because the input can be one of two states (a or b) D. Three because . .. . . . . E. Four because . . . . .
30
S1 S0
S2
31
State Assignment S0: 00 S1: 01 S2: 10
S1 S0
S2
32
33
0 2 6 4 1 3 7 5
x(t) Q1
0 1 - 1 0 0 - 0
Q0
34
D Q Q’ D Q Q’ Q1 Q0 D1 D0
Q1 x’
35
D Q Q’ D Q Q’ Q1 Q0 D1 D0
Q1 x’
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
36
Q0(t) Q1(t)
D Q Q’ D Q Q’
x(t) Q0(t) Q1(t)
37
Q0(t) Q1(t)
D Q Q’ D Q Q’
x(t) Q0(t) Q1(t)
38
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
Characteristic Expression:
39
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
Let: S0 = 00 S1 = 01 S2 = 10 S3 = 11
State Assignment
40
S1 S2 S3 S0
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
41
(0 or 1)/1
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
S1 S2 S3 S0
0/0 0/0 0/0 1/0 1/0 1/0
42
– Traffic sensors: TA, TB (TRUE when there’s traffic) – Lights: LA, LB
TA LA TA LB TB TB LA LB
Academic Ave. Bravado Blvd. Dorms Fields Dining Hall Labs
43
TA TB LA LB CLK Reset Traffic Light Controller
44
S0 LA: green LB: red Reset
45
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
46
47
State Encoding S0 00 S1 01 S2 10 S3 11
48
Output Encoding green 00 yellow 01 red 10
49
S1 S0 S'1 S'0 CLK
state register
Reset r
50
S1 S0 S'1 S'0 CLK
next state logic state register
Reset TA TB
inputs
S1 S0 r
51
S1 S0 S'1 S'0 CLK
next state logic
state register
Reset LA1 LB1 LB0 LA0 TA TB
inputs
S1 S0 r
52