Lecture No. 20
Dated: 02-01-2025
Finite Automaton
1 With Output
There are machines which take an input and generate a string
2 as output.
These machines are called machines with output
and there are two types.
Moore Machine
It consists of following
- A finite
set
3 ofstates
\(q_0, q_1, q_2, \ldots, q_n\) where \(q_0\) is theinitial state
. - An
alphabet
2 of letters \(\Sigma = \{a, b, c, \ldots\}\) from which the inputstring
2 is formed. - An
alphabet
2 of letters \(\Gamma = \{x, y, z, \ldots\}\) from which the outputstring
2 is formed. - A transition table showing for each
state
and each input letter, whatstate
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\) |
Now running the string
2 \(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\) |