Professional Documents
Culture Documents
Sequence Detectors
ECE 152A Winter 2012
Reading Assignment
Reading Assignment
Roth
Mealy Machine
Simpler (possibly)
Faster (possibly)
Outputs glitch
Used for synchronous (clocked) designs
Moore Machine
Deterministic Recognizers
State Diagram
Deterministic Recognizer
Those it accepts
Those it rejects
Deterministic Recognizers
Deterministic Recognizers
Definition of states
Deterministic Recognizers
Regular Expressions
10
Design Example
11
Design Example
State Diagram
0
Starting State
0
0
1
1
3
1
Accepting State
1
0
0
0
1
2
0
12
Design Example
x=0
x=1
AB
A+B+
A+B+
00
00
01
01
10
01
10
00
11
11
10
01
13
Design Example
AB
00
01
11
10
00
01
11
10
x
0
0
1
B+ = x
A+ = xB + xAB
14
Design Example
15
Verilog Code
state[1] = state
variable A
state[0] = state
variable B
Symbolic
states
16
Timing Simulation
Input sequence
terminal state
string accepted
Moore output
(stable for following period)
17
x=0
x=1
AB
A+B+
A+B+
00
00
01
01
10
01
10
00
11
11
10
01
18
PS
x=0
x=1
AB
A+B+
A+B+
00
00
01
01
10
01
10
00
11
11
10
01
x=0
x=1
AB
A+B+, Z
A+B+, Z
00
00,0
01,0
01
10,0
01,0
10
00,0
11,1
11
10,0
01,0
19
PS
x=0
x=1
AB
A+B+, Z
A+B+, Z
00
00,0
01,0
01
10,0
01,0
10
00,0
11,1
11
10,0
01,0
x=0
x=1
AB
A+B+
A+B+
00
00,0
01,0
01
10,0
01,0
10
00,0
01,1
20
21
State diagram
0/0
0
1/0
1/0
1
1/1
0/0
0/0
22
00
01
11
10
x
X
AB
00
01
11
10
1
0
00
01
11
10
X
AB
X
x
A+
= xB
B+ = x
z = xA
23
Verilog Code
Output
assigned to
declaratively
(wire)
Implementation
with case
statement
24
Timing Simulation
Input sequence
string accepted
25
Alternative Verilog
Code
Implemented
directly from next
state equations for
state variables A
and B
26
string accepted
27
28
0
1/0
1/0
Split State 1
1
1/1
0/0
0/0
States that 1B
can be entered
with different1 outputs (0 and
1 in this case) must be split
29
0/0
1A
0
0
1/0
1/0
Input = 1
1
1/1
0/0
0/0
1B
1
1/0
30
0/0
1A
0
0
1/0
0/0
Input = 0
1
1/1
0/0
0/0
0/0
1B
1
1/0
31
0/0
Output = 0
1A
0
0
1/0
0/0
1
1/1
Output = 1
0/0
0/0
1B
1
1/0
32
1
1/0
0/0
1
Output = 0
0
00
1A
1
0
0
0/0
1
0
0/0
Output = 1
2
2
0
0/0
0
1B
3
1
1
1/0
33