Skip to content

Lecture No. 20

Dated: 02-01-2025

Finite Automaton1 With Output

There are machines which take an input and generate a string2 as output.
These machines are called machines with output and there are two types.

Moore Machine

It consists of following

  • A finite set3 of states \(q_0, q_1, q_2, \ldots, q_n\) where \(q_0\) is the initial state.
  • An alphabet2 of letters \(\Sigma = \{a, b, c, \ldots\}\) from which the input string2 is formed.
  • An alphabet2 of letters \(\Gamma = \{x, y, z, \ldots\}\) from which the output string2 is formed.
  • A transition table showing for each state and each input letter, what state is entered next.
  • An output table showing what character is printed by each state as it is entered.

Example

\[\text{States}: q_0, q_1, q_2, q_3\]
\[\Sigma = \{a, b\}\]
\[\Gamma = \{0, 1\}\]
Old States New States after reading
Characters to be printed
\(a\) \(b\)
\(q_0\) \(q_1\) \(q_3\) \(1\)
\(q_1\) \(q_3\) \(q_1\) \(0\)
\(q_2\) \(q_0\) \(q_3\) \(0\)
\(q_3\) \(q_3\) \(q_2\) \(1\)

cs402_e_20_1.svg

Now running the string2 \(abbabbba\) over the machine will output \(100010101\).

Input a b b a b b b a
State \(q_0\) \(q_1\) \(q_1\) \(q_1\) \(q_3\) \(q_2\) \(q_3\) \(q_2\) \(q_0\)
Output \(1\) \(0\) \(0\) \(0\) \(1\) \(0\) \(1\) \(0\) \(1\)

References


  1. Read more about finite automaton

  2. Read more about foundations

  3. Read more about sets