DLD LAB # 13
DLD LAB # 13
DEPT: CS-03
GROUP MEMBERS
NAME:
REG NO:
37 40 44
Objective:
• Encourage students to understand the concepts of Finite State Machine (specifically Mealy
and Moore
types).
• Create and construct a sequential circuit by utilizing the principles of FSM.
Equipment:
Logic gates IC
Flip flops IC.
Connecting wires.
Digital logic trainer.
Introduction:
Finite state machine:
A computational model consists of a set of states, a starting state, an input alphabet, and a
transition function. This model operates by processing an input string, starting from the initial
state, and transitioning to new states based on the specified transition function. There are
different variations of this model, such as machines that associate actions or outputs with
transitions (Mealy machine) or this model, such as machines that associate actions or outputs
with transitions (Mealy machine) or states (Moore machine), machines with multiple starting
states, transitions that occur without input symbols (null transitions), or multiple transitions
for a given symbol and state (nondeterministic finite state machine). Additionally, these
machines may have one or more states designated as accepting states for specific purposes,
such as recognition.
Moore machines:
Moore machines are a type of finite state machine that has an output associated with each
state. The output value of a Moore machine depends solely on the current state it is in. A
Moore machine can be defined by several components.
It has a finite set of states, denoted by Q.
It also has an initial state, q0.
The machine operates on an input alphabet, represented by Σ, and produces output values
from an output alphabet.
The transition function, denoted by δ, maps a combination of a state and an input symbol
to a new state.
Finally, the output function, denoted by λ, maps each state to an output value.
In the Moore machine illustrated in the given figure, the output is associated with each
input state and is separated by a forward slash (/). The length of the output for a Moore
machine is one more than the length of the input. For example, when the input is “11”, the
machine undergoes the following transitions:
1. starting from state q0 with input 1, it transitions to state q2, and since there is no further
input, it remains in q2.
The corresponding output for this input sequence is “000”, where the first 0 represents
the output for state q0, the second 0 represents the output for state q2, and the third 0
again represents the output for state q2.
Mealy machines:
Mealy machines are another type of finite state machine that includes an output value
associated with each transition. The output value of a Mealy machine depends on both the
current state and the input symbol at that particular moment. A Mealy machine can be
defined using several components.
Firstly, it consists of a finite set of states denoted by Q.
It also has an initial state, q0.
The machine operates on an input alphabet represented by Σ and produces output values
from an output alphabet.
The transition function, denoted by δ, maps a combination of a state and an input symbol
to a new state.
Lastly, the output function, denoted by λ, maps a combination of a state and an input
symbol to an output value
In the depicted Mealy machine, the output is associated with each input symbol for each state
and is separated by a forward slash (/). The length of the output for a Mealy machine is equal
to the length of the input.
For instance, when the input is “11”, the machine undergoes the following transitions: starting
from state q0 with input symbol 1, it transitions to state q2, and the corresponding output for
this transition is 0. Then, from state q2 with input symbol 1 again, it remains in q2, and the
associated output for this transition is also 0.
Thus, the resulting output for this input sequence is “00”, where the first 0 represents the
output for the transition from state q0 to q2, and the second 0 represents the output for the
transition from state q2 to q2.
TASK RESULT
TASK1:
Design a sequence detector which detect 101.
Conditions are as:
You have to using Mealy state machine.
If it gets sequence like 1101101 it should detect it twice. (means
overlapping allowed).
When the sequence is detected it show 1 else 0.
You have to use D flip flop IC (7474) for this task.
Procedure:
1. Take two D flipflop ICs.
2. Connect toggle input to D input of first flipflop and also to a NOT gate.
3. Give a clock input to CLK of both flipflop ICs.
4. Connect output Q of first flipflop and output of NOT gate to an AND gate and connect its
output as an input of an OR gate.
5. Give 3 inputs, one of Q’ which is output of first flipflop, second of Q which id output of
second flipflop, and third of toggle.
6. Now attach its output as input as second input of OR gate and give its output as input at D
of second flipflop.
7. Connect output Q of both flipflops to an AND gate and connect its output to an LED.
8. We verified it and provided the sequence 101 for which the output should be 1(LED should
be ON) but as there were no faults after providing the correct sequence we checked, the LED
was ON.
101 Pattern Overlapping by Mealy and Moore
Machine: