Professional Documents
Culture Documents
Unit14 PDF
Unit14 PDF
Logic Design
Jie-Hong Roland Jiang
Fall 2012
Uri Alon
Nature Reviews Genetics, June 2007
2
Outline
Design of a sequence detector
More complex design problems
Guidelines for construction of state graphs
Serial data code conversion
Alphanumeric state graph notation
Conversion between Mealy and Moore
State Graphs
Clock
X 1 0 0 1 1 0 1 0
Clock
Z=Q
4
Design of a Sequence Detector
Sequential Parity Checker (recap)
State graph X=1
S0 S1
X=0 X=0
Z=0 Z=1
even odd
X=1
State table
Present Next State Present
State X=0 X=1 Output
Logic circuit
S0 S0 S1 0
S1 S1 S0 1
X T Q Z
state encoding/assignment
Q Q+ T Z Clock CK Q'
X=0 X=1 X=0 X=1
0 0 1 0 1 0
1 1 0 0 1 1 5
Sequence
X Z Z=1 input sequence
Detector
(data input) 101 is received
Clock
Input/output sequence example
X=0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 0
Z=0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0
Time: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
6
Design of a Sequence Detector
{101}-Sequence Detector
Mealy machine
State diagram
0 1 0 1
S0 0
S0 0
0 0
0 1
S0 0 1
0 1 1
1 S1 0 1 S1 0
0
S1
S2 0 S2 0
0 0
State table
Present A+B+ Z
Present Next State Output AB X=0 X=1 X=0 X=1
State X=0 X=1 X=0 X=1 00 00 01 0 0
S0 S0 S1 0 0 01 10 01 0 0
S1 S2 S1 0 0 10 00 01 0 1
S2 S0 S1 0 1 11 - - - -
S0: initial state
S1: sequence ending with 1 received
S2: sequence ending with 10 received 7
11 x x 11 x x 11 x x
10 0 0 10 0 1 10 0 1
Circuit realization A+=X'B B+=X Z=XA
Assume A,B can be reset to 0
A' A B' B (Need to be careful about the
dont care assignment if the
CK D CK D FFs do not have reset when
powered up)
Clock
Z
000010
X
011010 8
Design of a Sequence Detector
{101}-Sequence Detector
Moore machine
State diagram
S0 1 S1 S0 1 S1 S0 1 S1
0 0 0 1
0 0 0 0 0 0
0 0 0
1 0
1
S2 S3 1 S2 S3 S2
0 1 0 1 0
0
State table
Present
Next State Output A+B+
Present
State X=0 X=1 Z AB X=0 X=1 Z
S0 S0 S1 0 00 00 01 0
S1 S1 S2 0 01 11 01 0
S2 S2 S0 0 11 00 10 0
S3 S3 S1 1 10 11 01 1
9
Sequence
X Z
Detector
(data input)
Z=1 input sequence
010 or 1001 is received
Clock
Input/output sequence example
X=0 0 1 0 1 0 0 1 0 0 0 1 0 0 1 1 0
Z=0 0 0 1 0 1 0 1 1 0 0 0 1 0 1 0 0
Time: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
10
More Complex Design Problems
{010,1001}-Sequence Detector
Mealy machine implementation
(1) Partial graph for 010 S0
State Sequence received
0
0 S0 reset
S1
S1 0
1
0 0 S2 01
1
S2 S3 S3 010
a 1
0
(2) Partial graph for 1001 (3) Complete state graph
S0 S0
12
More Complex Design Problems
Modified Parity Sequence Detector
Block diagram
Sequence
X Z
Detector
(data input)
Z=1 the total number
of 1s received is odd and
at least two consecutive
Clock 0s have been received
X= 1 0 1 1 0 0 1 1
odd odd odd odd odd odd
Z = (0) 0 0 0 0 0 1 0 1
13
1 1 1
S0 S1 S2 S5
0 0 0 0
1
0 0
15
16
Construction of State Graphs
Example 1
Block diagram
Z=1 input sequence
Sequence 0101 or 1001 occurs
X Z
Detector
(data input)
The circuit examines groups
of 4 consecutive inputs, and
resets after every 4 inputs
Clock
S1 1 1 S2
0 0
0 0 0
0 0
0 0 0
1 1
0 1
S5 S3
0 1 0
0 0 1 0
0
S6 S4
State Sequence received
S0 reset State Sequence received
S1 0
S5 two inputs received, no 1 output is possible
S2 1
S6 three inputs received, no 1 output is possible
S3 01 or 10
S4 010 or 100
18
Construction of State Graphs
Example 2 (omitted)
Block diagram
Z1
Sequence
X
Detector Z2
(data input)
S0
1 0
00 00
S1 S3
0 1
00 00
S2 S4
0 0
10 01
State Description
S0 No progress on 100 No progress on 010
S1 Progress of 1 on 100 No progress on 010
010 has never
S2 Progress of 10 on 100 Progress of 0 on 010
occurred
S3 No progress on 100 Progress of 0 on 010
S4 Progress of 1 on 100 Progress of 01 on 010
S5 Progress of 0 on 010
010 has
S6 Progress of 01 on 010
occurred
partial graph for 010 S7 No progress on 010 20
Construction of State Graphs
Example 2 (omitted)
State table
21
X1
Sequence Z
X2 Detector
Clock
22
Construction of State Graphs
Example 3 (omitted)
Moore machine implementation
Observation:
Only the previous and present inputs (input sequence of
length 2) will determine the output
Unnecessary to use a separate state for 00 and 11 because
neither input starts a sequence which leads to an output
change
State designation
Previous Input (X1X2) Output (Z) State Designation
00 or 11 0 S0
00 or 11 1 S1
01 0 S2
01 1 S3
10 0 S4
10 1 S5
23
State graph
24
Serial Data Code Conversion
Transmission of serial bit streams
Two common approaches
1. Clock signal transmitted along with the data
Serial Data
Transmitter Receiver
Clock
Transmitter Receiver
Clock Clock
Recovery
Circuit
25
Example
Bit Sequence 0 1 1 1 0 0 1 0
NRZ
NRZI
RZ
Manchester
Clock
1 bit
time 26
Serial Data Code Conversion
NRZ-Code to Manchester-Code
Mealy machine implementation
Use Clock2, twice the frequency of the basic clock
If the NRZ bit is 0 (1), it will be 0 (1) for two Clock2 periods
X
NRZ data Z Manchester
Converter
Clock2 data
NRZ(X) 0 0 1 1 1 1 1 1 0 0 0 0 1 1 0 0
1 S0 0
1 0 Manchester
(ideal) 0 1 1 0 1 0 1 0 0 1 0 1 1 0 0 1
1 0 Clock2
S2 0 1 S1
State S0 S1 S0 S2 S0 S2 S0 S2 S0 S1 S0 S1 S0 S2 S0 S1
Z (actual)
Present Next State Output Z
State 1 clock period glitch (false output)
X=0 X=1 X=0 X=1
S0 S1 S2 0 1
S1 S0 - 1 -
S2 - S0 - 0
27
1 1 0 0
Clock2
S3 S2
S0 S1 S2 S3 S0 S3 S0 S3 S0 S1 S2 S1 S2 S3 S0 S1
1 1 1 State
Z 0 0 1 1 0 1 0 1 0 0 1 0 1 1 0 0
S0 S1 S3 0
S1 S2 - 0 Output delayed by one clock period
S2 S1 S3 1
S3 - S0 1
28
Alphanumeric State Graph Notation
State graphs with variable names on arc labels
(and in states for Moore machine)
Example Z1
F
Sequential Z2
Circuit Completely specified state graph
R Z3
F'R'
Clock
S0
Incompletely specified state graph
Z1
S0 F F
Z1
F'R F'R
F F
R R
F'R' S2 F'R S1 F'R'
Z3 Z2
S2 R S1 F
Z3 Z2
29
F
S0
PS NS Output
Z1
F F FR=00 01 10 11 Z1Z2Z3
31
E.g., for a circuit with 4 inputs (X1, X2, X3, X4) and 4
outputs (Z1, Z2, Z3, Z4)
32
Conversion between Mealy and Moore
State Graphs
Convert Mealy to Moore
1. Push the output label on an edge to its next state (so
delay introduced!)
2. If a state receives different output labels, duplicate the
state such that every copy has exactly one output label
3. Connect every edge properly to the state with correct
output label
33
S0 1 S1
0 1
0 1 0 0
S0 0
0
1 1
0
0 1 S1 0
0 1 0
1
S2 0 S3 S2
0 1 0
0
34