Beruflich Dokumente
Kultur Dokumente
Seminar Report
On
FLIP FLOP CIRCUITS, MEALY AND
MOORE MODEL
In partial fulfillment of requirements for the degree of
Bachelor of Engineering
In
Electronics & Communication Engineering
Submitted By
SURAJ. P. B
Page
INDEX
1. Introduction - Page 3
2. SR Latch -
Page 4
3. D Flip-Flop Page 8
4. JK Flip Flop Page 9
5. T Flip flop Page 10
6. Mealy and Moore Model with examples Page 11
Page
Introduction
Page
S-R Latch:
Q '
S
(a) Logic Diagram
Symbol
Q'
(b)Graphic
Q'
Q'
0
1
1
1
0
1
0
1
-
1
0
-
Comme
nt
Hold
State
Reset
Set
Forbidde
n
Q '
Page
Q'
Q'
0
1
1
0
1
0
0
1
Q'
(b)Graphic
Comme
nt
Hold
State
Set
Reset
Forbidde
n
Q '
Q'
(b)Graphic
Symbol
S
Q'
Q'
0
1
1
1
0
1
1
1
1
0
1
-
1
0
-
Q'
Comme
nt
Hold
State
Reset
Set
Forbidde
n
Hold
State
never equal to 1 at the state time. This is done level sensitive D latch
shown in Figure.4.4. The latch has only two inputs: D and C. The D
input connect directly to the S input and its complement is applied to
the R input. The D input is sampled when C is equal to 1. If D is
equal to 1, the Q output goes to 1. If D is equal to 0, the Q output goes
to 0. If C is equal to 0, the Q output remains in its previous state [1].
D
Q
Q '
Q'
(b)Graphic
Symbol
C
1
1
0
D
0
1
x
Q
0
1
Q
Q'
1
0
Q'
C
Page
Q '
Q'
(b)Graphic
Symbol
C
Q'
1
1
1
1
0
0
0
1
1
x
0
1
0
1
x
Q
0
1
Q'
Q
Q'
1
0'
Q
Q'
Commen
t
Hold
Reset
Set
Toggle
Hold
D Flip-Flop:
Positive-Edge Triggered:
CLK
Q'
Q'
Q'
Negative-Edge Triggered:
Q
CLK
Q'
Q'
Q'
CLK
Q'
J-K Flip-Flop:
Page
Positive-Edge Triggered:
CLK
0
1
Q'
Q'
Q'
x
x
x
x
Q
Q
Q'
Q'
Q'
Q'
Q
CLK
0
1
Q'
x
x
x
x
Q
Q
Q'
Q'
Q'
Page
T Flip-Flop:
CLK
CLK
0
1
Q'
Q'
Q'
x
x
Q
Q
J
CLK
Q'
Q'
Q'
INPUT
INPUT
STATE
STATE
OUTPUT
OUTPUT
INPUT
Page
Example: Design a simple sequence detector for the sequence 011. Include three outputs
that indicate how many bits have been received in the correct sequence. (For example,
each output could be connected to an LED.)
1) Draw a State Diagram (Moore) and then assign binary State Identifiers.
1
X=1
X=0
X=0
A
B
000
001
X=0
X=1
X=0
X=1
111
011
X=1
Q1
0
0
0
0
1
1
1
Page
State
A
A
B
B
D
D
C
C
X
0
1
0
1
0
1
0
1
O2
0
0
0
0
1
1
0
0
O1
0
0
0
0
1
1
1
1
O0
0
0
1
1
1
1
1
1
State+
B
A
B
C
B
A
B
D
Q0
0
0
1
1
0
0
1
X
0
1
0
1
0
1
0
O2
0
0
0
0
1
1
0
O1
0
0
0
0
1
1
1
O0
0
0
1
1
1
1
1
Q1 +
0
0
0
1
0
0
0
Q0 +
1
0
1
1
1
0
1
STATES
Page
A=00
B=01
C=11
D=10
Q0
0
0
1
1
0
0
1
1
X
0
1
0
1
0
1
0
1
O2
0
0
0
0
1
1
0
0
O1
0
0
0
0
1
1
1
1
Q1+
0
0
0
1
0
0
0
1
O0
0
0
1
1
1
1
1
1
Q0+
1
0
1
1
1
0
1
0
D1
0
0
0
1
0
0
0
1
D0
1
0
1
1
1
0
1
0
00
0
0
01
0
1
11
0
1
X\Q1Q0
0
1
10
0
0
00
1
0
01
1
1
11
1
0
10
1
0
D0 = X +Q1Q0
D1 = XQ0
0
0
1
O 2 = Q1
Q0
1
0
0
Q1\Q0
0
1
0
0
1
O1 = Q1
1
0
1
Q1\Q0
0
1
O0 = Q1 +Q0
0
0
1
1
1
1
Example: Design a sequence detector that searches for a series of binary inputs to satisfy
the pattern 01[0*]1, where [0*] is any number of consecutive zeroes. The output (Z)
should become true every time the sequence is found.
1) Draw a State Diagram (Moore) and then assign binary State Identifiers.
Recall: Picking state identifiers so that only one bit changes from state to state will
generally help reduce the amount of hardware required for implementation. Only
the transition from Success to First requires two bits to change.
2) Make a Next State Truth Table (NSTT)
State
Start
Start
First
First
Success
Success
Second
Second
Unused
SuccessD
SuccessD
Delay
Delay
Q2
0
0
0
0
0
0
0
0
1
1
1
1
1
Q1
0
0
0
0
1
1
1
1
0
1
1
1
1
Q0
X
0
0
1
1
0
0
1
1
*
0
0
1
1
0
1
0
1
0
1
0
1
*
0
1
0
1
Z
0
0
0
0
1
1
0
0
X
1
1
0
0
State+
First
Start
First
Second
First
Start
Delay
Success
X
Delay
Success
Delay
SuccessD
Q2 +
0
0
0
0
0
0
1
0
X
1
0
1
1
Q1 +
0
0
0
1
0
0
1
1
X
1
1
1
1
Q0 +
1
0
1
1
1
0
1
0
X
1
0
1
0
INPUT/OUTPUT
STATE
INPUT/OUTPUT
STATE
INPUT/OUTPUT
Example: Design a sequence detector that searches for a series of binary inputs to satisfy
the pattern 01[0*]1, where [0*] is any number of consecutive zeroes. The output (Z)
should become true every time the sequence is found.
1) Draw a State Diagram (Mealy) and then assign binary State Identifiers.
Initialize
_
0
_
1
1
0
0
2
0
0
0
3
0
0
0
4
1
0
0
5
0
0
0
6
0
0
0
7
1
0
1
8
0
1
0
9
1
0
1
A
1
1
1
B
1
1
0
C
0
0
0
Start
_
Start
Start
Start
First
First
First
First
Second
Second
Delay
Delay
Delay
Delay
SuccD
SuccD
Delay
Delay
SuccD
SuccD
Succ
Succ
Start
Start
First
Note: The Moore Machine lags one clock cycle behind the final input in the
sequence. The Mealy Machine can change asynchronously with the input.
One of the states in the previous Mealy
State Diagram is unnecessary:
Note: The Mealy Machine requires one less state than the Moore Machine! This is
possible because Mealy Machines make use of more information (i.e. inputs) than
Moore Machines when computing the output. Having less states makes for an easier
design because our truth tables, K-maps, and logic equations are generally less
complex. In some cases, the reduction of states is significant because it reduces the
number of flip-flops required for design implementation. In spite of the advantages of
using a design with less states,
We will still use the 6-state
Mealy Machine for the remainder of these notes to facilitate a direct
comparison with the 6-state Moore Machine.
2) Make a Next State Truth Table (NSTT)
State
Q2
Q1
Q0
Start
0
Start
0
First
0
First
0
Success
0
Success
0
Second
0
Second
0
unused
1
SuccessD
1
SuccessD
1
Delay
1
Delay
1
State+
Z
0
First
0
Start
0
First
0
Second
0
First
0
Start
0
Delay
1
Success
X
X
0
Delay
1
Success
0
Delay
1
SuccessD
0
0
0
0
1
1
1
1
0
1
1
1
1
Q2+
0
0
0
0
0
0
1
0
X
1
0
1
1
0
0
1
1
0
0
1
1
*
0
0
1
1
Q1+
0
0
0
1
0
0
1
1
X
1
1
1
1
0
1
0
1
0
1
0
1
*
0
1
0
1
Q0 +
1
0
1
1
1
0
1
0
X
1
0
1
0
State
Start
Start
First
First
Success
Q2
0
0
0
0
0
Q1 Q0 X
0
0
0
0
0
1
0
1
0
0
1
1
1
0
0
Z
0
0
0
0
0
State+
First
Start
First
Second
First
Q2 +
0
0
0
0
0
Q1+
0
0
0
1
0
Q0+
1
0
1
1
1
D2
0
0
0
0
0
D1
0
0
0
1
0
D0
1
0
1
1
1
Success
Second
Second
unused
SuccessD
SuccessD
Delay
Delay
0
0
0
1
1
1
1
1
1
1
1
0
1
1
1
1
0
1
1
*
0
0
1
1
1
0
1
*
0
1
0
1
0
Start
0
Delay
1 Success
X
X
0
Delay
1 Success
0
Delay
1 SuccessD
0
1
0
X
1
0
1
1
0
1
1
X
1
1
1
1
0
1
0
X
1
0
1
0
0
1
0
X
1
0
1
1
0
1
1
X
1
1
1
1
0
1
0
X
1
0
1
0
D2 = Q2Q0 +Q2
11 10
0 0
0 1
1 1
X X
Q2Q1\Q0X 00 01 11 10
00
0
0
1
0
01
0
0
1
1
11
1
1
1
1
10
X
X
X
X
Q2Q1\Q0X 00 01
00
1 0
01
1 0
11
1 0
10
X X
D0 = Q0 X +Q0 X +Q1Q0
0
0
1
1
X
1
0
0
0
X
Q2Q1\Q0X 00
00
0
01
0
11
0
10
X
=Q
01
0
0
1
X
11
0
1
1
X
10
0
0
0
X
= Q X +Q Q X
Mealy
2
1
0
Q0
Recall: Moore outputs do not depend on the input.
- ZMoore can only change when the state changes (synchronous).
- ZMealy can change asynchronously because it can change with X.
Moore
Note: The Moore and Mealy Machines solve the same problem.
7) Implement the circuit
D2
X, Q2, Q1, Q0
Q2
Combo
Logic
D-FF
D1
X, Q2, Q1, Q0
Combo
11 10
1
1
0
1
0
1
X X
Q1
Z
Combo
Logic
D-FF
D0
X, Q2, Q1, Q0
Q Q0
Combo
Logic
Logic
D-FF
Q
Clk
Notes: The 3 boxes of combinational logic on the left are the same for both of the Moore
and Mealy designs because the state transitions are the same. This would not have been
the case had we implemented the 5-state Mealy Machine.
The larger box of combinational logic on the right is different for the Moore and Mealy
designs because the output, Z, is computed differently