|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Finite state machines |
|
|
|
|
|
|
|
Combinational circuit:
implements Boolean function |
|
|
|
Sequential circuit:
implements finite state machine |
|
|
|
May also contain
combinational circuit |
|
|
|
In programming languages
(i.e., 330), DFA (deterministic
finite automaton) |
|
|
|
Essentially the same, but
different purpose |
|
|
DFA: |
|
|
|
|
Q, a set of states |
|
|
|
|
S, a single state which
is an element of Q. This is the start state. |
|
|
|
|
|
F, a set of states
designated as the final states |
|
|
|
|
|
Sigma, the input alphabet |
|
|
|
|
|
delta, a transition function that maps a state
and a letter from the input alphabet, |
|
|
|
to the next state |
|
|
|
|
|
DFA is used to recognize
a language L, which is composed of a set of strings |
|
|
|
|
made up from an input
alphabet |
|
|
|
|
|
|
If DFA can recognize
strings in the language, then L has a regular grammar |
|
|
|
To use DFA: |
|
|
|
|
|
|
Start in initial state S |
|
|
|
|
|
|
Process each character
in the input string, moving from state to state |
|
|
|
|
If DFA in a final state
after processing the last character, string in language |
|
|
|
Example: alphabet a, b |
|
|
|
|
|
Is string
"aabb" recognized by a DFA? |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|