Introduction to Stateflow with Applications

Chapter 9: Mealy and Moore Charts in Stateflow

This chapter begins with an overview of the Mealy and Moore machines, then describes the procedure for creating Mealy and Moore charts in Stateflow, and concludes with illustrative examples for each.

9.1 Mealy Machine Defined

In the theory of computation, a Mealy machine is a finite state machine that generates an output based on its current state and an input. This means that the state diagram will include both an input and output signal for each transition edge.

Example 9.1

This is a Mealy machine example.

Let us consider the state table below denoted as Table 9.1.

Table 9.1

Present State

Input

Next State

Output

Q 1 n

Q 0 n

x

Q 1 n + 1

Q 0 n+1

y

0

0

0

0

1

0

0

0

1

1

1

1

0

1

0

1

0

0

0

1

1

0

0

1

1

0

0

1

1

0

1

0

1

0

1

1

1

1

0

0

0

0

1

1

1

1

0

1

We can represent the state table above with the timing diagram shown in Figure 9.1 below.


Figure 9.1: Timing diagram for state table Table 9.1

The Mealy machine for the state table in Table 9.1 and timing diagram in Figure 9.1 is shown in Figure 9.2 below.


Figure 9.2: The Mealy machine for Example 9.1

In the state diagram in Figure 9.2, the numbers inside the states represented by the circles are the four states of a synchronous counter...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Digital Parallel and Serial Converters
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.