What are the advantages and disadvantages of membrane structures.pptx
Applications of Mealy & Moore Machine
1. Applications of Mealy & Moore Machine
Submitted To:
•Ma’m Iqra Yaqoob
Submitted By:
•Muhammad Kashif 25
Bachelor in computer Science
BSCS (Morning) 4 Years
Session: 2016-2020
2. What is (Finite State Machine)FSM?
A finite state machine is a
machine that has many states and has a logical way of
changing from one state to the other under guiding rules.
Types of FSM Without output (answer true or false)
1. Finite State Automata - With output
2. Mealy machine - output on transition
3. Moore machine - output on state
3. Mealy Machine
A Mealy Machine
is an FSM whose output depends on the present state as
well as the present input. In Mealy machine every
transition for a particular input symbol has a fixed output.
4. Mealy Machine(Cont.)
• It can be described by a 6 tuple (Q, ∑, O, δ, X, q0) where −
1. Q is a finite set of states.
2. ∑ is a finite set of symbols called the input alphabet.
3. O is a finite set of symbols called the output alphabet.
4. δ is the input transition function where δ: Q × ∑ → Q
5. X is the output transition function where X: Q → O
6. q0 is the initial state from where any input is processed (q0 ∈ Q).
5. Moore Machine:
• In Moore machine. the value of output function is depend on the
present state only. Moore machine is described by 6-tuples - (Q, Σ, Δ, δ, λ, q0) where
1. Q = Finite non-empty set of states;
2. Σ = Set of input alphabets.
3. Δ = Set of output alphabets.
4. δ = Transition function mapping Q X Σ → Q
5. λ = Output function mapping Q → Δ
6. q0 = Initial state..
6. Advantages of Mealy and Moore state Machines
• Moore machines are cheap
• They are easy to use
• Moore state machines are very fast
• Mealy machines are reactive i.e. they have a low response time (they are
fast)
Disadvantages of Mealy and Moore state Machines •
Mealy state machines are expensive to produce
• Number of states can become unmanageable (they become too many)
7. Uses of Mealy and Moore state Machines
• Mealy state machines are used in processors due to their property of having many states
• Mealy state machines are also used to provide a rudimentary mathematical model for
cipher machines
• A Moore state machine is used as a right enable in SRAM because of its speed.
• It is used in SRAM because SRAM needs a level-sensitive control (signal has to be
asserted for an amount of time)
8. Mealy and Moore• Both have:
– No final state
– Produce output from an input string
– No non-determinism
• Mealy machines produce output on transition
• Moore machines produce output on state
9. Comparisson between melay ans moore machine
• the Mealy state machine’s state is changed by the inputs and the state of the machine
but The Moore state machine’s state is affected by the state of the machine only
• Moore machines are slower than the Mealy machines
• Moore machines are easier to compose than Mealy machines .
• The Moore state machine takes at least one clock cycle to change the state of the
machine while the Mealy state machine is guaranteed to use more than one clock
cycle.
• Moore machines are cheap.
• They are easy to use.
• Moore state machines are very fast.
• Mealy machines are reactive i.e. they have a low response time (they are fast)
10. Comparison of Mealy and Moore FSM
• Mealy machines have less states – outputs are on transitions (n2) rather than
states (n)
• Moore machines are safer to use – outputs change at clock edge (always one
cycle later) – in Mealy machines, input change can cause output change as soon
as logic is done – a big problem when two machines are interconnected –
asynchronous feedback may occur if one isn’t careful
• Mealy machines react faster to inputs – react in same cycle – don't need to
wait for clock – outputs may be considerably shorter than the clock cycle – in
Moore machines, more logic may be necessary to decode state into outputs –
there may be more gate delays after clock edge
11. Examples of mealy and morre machine
1.) Like take the example of implementation of Elevator functionality using a state
diagram.
2.) Each time you do a search (particularly a "pattern search") in your favorite
editor/tool, the pattern is translated into some form of finite state machine, which
does the matching.
3.) The lexical analysis part of your compiler/interpreter (yes, even your shell) is
again a finite automaton which matches keywords and other tokens recognized by the
language.
4.) Any vending machine is a finite automaton which takes in coins of different
denominations and recognizes when the correct amount has been entered (OK,
today's vending machines probably have a small CPU inside doing the adding, but the
end result is the same).