0% found this document useful (0 votes)
126 views

Moore Mealy Machine Lecture-1

The document discusses regular expressions, finite automata machines, and two types of finite state machines - Mealy and Moore machines. Regular expressions are a way to represent strings and can include operators like +, *, and (). Finite automata machines are a graphical way to define languages and are composed of states, inputs, transitions, an initial state, and final states. There are two types of finite automata - deterministic (DFA) and non-deterministic (NFA). DFA has one path per input between states while NFA can have multiple paths. Mealy machines output depends on state and input, represented with state/input pairs. Moore machines output depends only on state. Transition tables can represent the state transitions

Uploaded by

ali yousaf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
126 views

Moore Mealy Machine Lecture-1

The document discusses regular expressions, finite automata machines, and two types of finite state machines - Mealy and Moore machines. Regular expressions are a way to represent strings and can include operators like +, *, and (). Finite automata machines are a graphical way to define languages and are composed of states, inputs, transitions, an initial state, and final states. There are two types of finite automata - deterministic (DFA) and non-deterministic (NFA). DFA has one path per input between states while NFA can have multiple paths. Mealy machines output depends on state and input, represented with state/input pairs. Moore machines output depends only on state. Transition tables can represent the state transitions

Uploaded by

ali yousaf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Mealy and Moore Machine

Regular Expression
It is the most effective way to represent string.
- R.E = a+
Strings = a, aa, aaa, aaaa, aaaaa,……….

- R.E = a*
Strings = Λ, a, aa, aaa, aaaa, aaaaa,……….

- R.E = (a+b)
Strings = a, b

Examples
R.E = a(a+b)*
Strings: a, aa, ab, aab, aaab, aba, ababab,…
R.E = (a+b)* a (a+b)* a (a+b)*
Strings={aa, aaa, baa,aab, aba, abba,…}
Finite Automata:
It is another method for defining language in graphical
form. It is also known as Finite Automata Machine.

A FAM is a collection of 5-tuple(), where


 Q: finite set of states
 ∑: finite set of the input symbol
 q0: initial state
 F: final state
 δ: Transition function

There are two types of finite Automata


1) DFA (Deterministic Finite Automata)
2) NFA (Non-Deterministic Finite Autmoata)
DFA (Deterministic Finite Automata)
The finite automata are called deterministic finite
automata if the machine is read an input string one
symbol at a time.

Rules
 In DFA, there is only one path for specific input from
the current state to the next state.
 DFA does not accept the null move, i.e., the DFA
cannot change state without any input character.
 DFA can contain multiple final states.
 One letter cannot go to many state from one state.
Dead State: A rejecting state is known as dead state.
This state occurs, when an entry for initial state is not
accurate according to required input.
Non-Deterministic Finite Automata
DFA is defined by 5 parts/tuples
NFA is also defined by same 5 parts.
NFA Rule:
1) According to DFA, one letter cannot move to
more than 1 state, there is only one output so the
next state is already determined.
According to NFA one letter can move to more
than one state, next state is not determined.
2) In NFA, Dead End state is not required.
3) In NFA, State can be null. Its mean, can move
to other state without any input. This is known as
null or epsilon transition. It is denoted as є-NFA
DFA vs NFA
FA

FA without FA with
output output

Mealy Moore
TG NFA DFA
Machine Machine
Transition Table
Transition table is tabular representation of
transition function.
It takes two argument (a state and a
symbol) and returns a state (the “next
state”)
We write all states in column and
transitions in a row.
State (current) Input Next State
q0 q1 q2
q1 q0 Q2
q2 q2 q2
Transition Table

State (current) Input - 0 Input-1


q0 q1 q2
q1 q0 q2
q2 q2 q2
Transition Table

States Input-0 Input-1


q0
q1
q2
q3
Mealy Machine:
Finite State Machine
Mealy machine is a finite-state machine whose
output values are determined both by its
current state and the current input.

In Mealy machine, the output is represented


with each input symbol for each state
separated by /.

The Mealy machine can be described by 6


tuples (Q, q0, ∑, O, δ, λ')
Mealy Machine:
Finite State Machine
1. A finite set of states q0, q1, q2, … where q0 is
the initial state.
2. An alphabet of letters  = {a, b, c,…} from
which the input strings are formed.
3. An alphabet O={x, y, z,…} of output characters
from which output strings are generated.
4. A pictorial representation with states and
directed edges labeled by an input letter along
with an output character. The directed edges
also show how to go from one state to another
corresponding to every possible input letter
Design Transition Table from
Mealy Machine

Present Input-0 Input-1


State State Output State Output
Moore Machine
Moore machine is a finite state machine, in
which the next state is decided by the
current state and current input symbol.
A Moore machine can be defined as a 6-
tuple (Q, q0, ∑, O, δ, λ')
In state transition diagram, output are
labeled in the circle rather than on the arcs.
Moore Machine

You might also like