Prerequisite – Mealy and Moore machines

A **sequence detector** is a sequential state machine which takes an input string of bits and generates an output 1 whenever the target sequence has been detected.In a Mealy machine, output depends on the present state and the external input (x). Hence in the diagram, the output is written outside the states, along with inputs. Sequence detector is of two types:

- Overlapping
- Non-Overlapping

In an overlapping sequence detector the last bit of one sequence becomes the first bit of next sequence.However, in non-overlapping sequence detector the last bit of one sequence does not become the first bit of next sequence.In this post, we’ll discuss the design procedure for non-overlapping 101 Mealy sequence detector.

Examples:

For non overlapping case Input :0110101011001 Output:0000100010000 For overlapping case Input :0110101011001 Output:0000101010000

The steps to design non-overlapping 101 Mealy sequence detector are:

**Step 1: Develop the state diagram –**

The state diagram of a Mealy machine for a 101 sequence detector is:

**Step 2: Code Assignment –**

**Rule 1 **: States having the same next states for a given input condition should have adjacent assignments.

**Rule 2**:States that are the next states to a single state must be given adjacent assignments.

Rule 1 given preference over Rule 2.

The state diagram after the code assignment is:

**Step 3: Make Present State/Next State table –**

We’ll use D-Flip Flops for design purpose.

**Step 4: Draw K-maps for Dx, Dy and output (Z) –**

**Step 5: Finally implement the circuit –**

This is the final circuit for a Mealy 101 non overlapping sequence detector.

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

## Recommended Posts:

- Difference between Mealy machine and Moore machine
- Design a mealy machine for 2's complement
- Conversion of Moore to Mealy machine (Set 4)
- Conversion of Moore to Mealy machine (Set 10)
- Conversion of Moore to Mealy machine (Set 9)
- Mealy Machine for 1's Complement
- Mealy and Moore Machines in TOC
- Moore and Mealy machines to count number of substring ‘ab’
- Moore and Mealy machines to produce 'A', 'B', 'C' depends on inputs that end with ’10’ or with ’11’ else other
- RTL (Register Transfer Level) design vs Sequential logic design
- Design counter for given sequence
- Turing Machine in TOC
- Turing Machine for subtraction | Set 2
- Construct Turing machine for L = {a
^{n}b^{m}a^{(n+m)}| n,m≥1} - Construct a Turing Machine for language L = {0
^{n}1^{n}2^{n}| n≥1} - Construct a Turing Machine for language L = {ww
^{r}| w ∈ {0, 1}} - Construct a Turing Machine for language L = {ww | w ∈ {0,1}}
- Construct a Turing machine for L = {a
^{i}b^{j}c^{k}| i>j>k; k ≥ 1} - Turing Machine for addition
- Turing machine for multiplication

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.