Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

April 30, 2014

FINITE STATE MACHINES


(MEALY AND MOORE MACHINES)
Gookyi Dennis A. N.
SoC Design Lab.
Contents:
• Introduction
• Moore machines
• Mealy machines
• Comparison

2
Introduction:
• FSM’s can exist in several states and it goes from one
state to another state based on the present state and
the input conditions
• Any synchronous circuit is an FSM of some form
• This means that:
 Combinational logic is an FSM without memory
 Flip-Flops and counters are also FSM’s

3
General FSM

4
General FSM
• The circuit diagram consists of:
Combinational block: with primary input w
and primary output z. it also consist of
secondary inputs (present state) and
secondary outputs (next state)
Memory block: consist mainly of Flip-Flops.

5
Outputs of state machines:
• No provision has been made to show the
output z which is different from the state
variables. The output can therefore be
modelled in two distinct ways
Moore machines
Mealy machines

6
Moore machines:

•Edward Moore’s model:


D = F(W,Q)
Z = G(Q)
F and G are Boolean functions
Output only depends on the current state (Q)
Input (W) and current state (Q) determine the next
state (D)

7
Moore state graph:

8
Moore state table
Present state Input Next state output

A B W Z

0 0 0 0 0 0

0 0 1 0 1 0

0 1 0 1 0 0

0 1 1 0 1 0

1 0 0 0 0 1

1 0 1 0 0 1

1 1 0 x x 0

1 1 1 x x 0

9
Moore maps

10
Moore circuit diagram:

11
Mealy machines

• George Mealy’s model


 D = F(W,Q)
 Z = G(W,Q)
 F and G are Boolean functions
 Output depends on both current state (Q) and input
(W)
 Next state (D) depends on input (W) and current
12state (Q)
Mealy state graph

13
Mealy state table

Present state Input Next state output

A B W Z

0 0 0 0 0 0

0 0 1 0 1 0

0 1 0 1 0 1

0 1 1 0 1 0

1 0 0 0 0 0

1 0 1 0 0 1

1 1 0 x x 0

1 1 1 x x 0

14
Mealy maps

15
Mealy circuit diagram

16
Comparison: Moore vs Mealy
• Moore machines are safer to use
Output change at clock edge
In mealy machines, input change can cause
output to change as soon as logic is done.
• Mealy machines are faster because the output
is dependent on the inputs.

17
Choosing between Moore and Mealy
machines
• It actually comes down to the task at hand when
choosing between Mealy and More machines
• These are a few questions to ask when choosing
between either of the two:
 Does one want to have a synchronous or asynchronous
machine?
 Is speed paramount?
 Are both the inputs and present state readily available?
• The answer to each of these questions determines the
type of machine that would work best.

18

You might also like