# the number of states required to design melay sequence detector for the sequence 1011 is

### Mohammed

Guys, does anyone know the answer?

get the number of states required to design melay sequence detector for the sequence 1011 is from screen.

## Appendix – Design of the 11011 Sequence Detector

**Problem:**Design a 11011 sequence detector using JK flip-flops. Allow overlap.

Step 1 – Derive the State Diagram and State Table for the Problem

The method to be used for deriving the state diagram depends on the problem. I show the method for a sequence detector. At this point in the problem, the states are usually labeled by a letter, with the initial state being labeled “A”, etc.

Step 1a – Determine the Number of States

It can be proven that an N-bit sequence detector requires at least N states to function correctly. It can also be shown that a circuit with more than N states is unnecessarily complicated and a waste of hardware; thus, an N-bit sequence detector has N states.

We are designing a sequence detector for a 5-bit sequence, so we need 5 states. We label these states A, B, C, D, and E. State A is the initial state.

Step 1b – Characterize Each State by What has been Input and What is Expected

State Has Awaiting

A -- 11011

B 1 1011

C 11 011

D 110 11

E 1101 1

Step 1c – Do the Transitions for the Expected Sequence

Here is a partial drawing of the state diagram. It has only the sequence expected. Note that the diagram returns to state C after a successful detection; the final 11 are used again.

Note the labeling of the transitions: X / Z. Thus the expected transition from A to B has an input of 1 and an output of 0.

The transition from E to C has an output of 1 denoting that the desired sequence has been detected.

Step 1d – Insert the Inputs That Break the Sequence

Each state has two lines out of it – one line for a 1 and another line for a 0.

The notes below explain how to handle the bits that break the sequence.

**A**State A is the initial state. It is waiting on a 1. If it gets a 0, the machine remains

in state A and continues to remain there while 0’s are input.

**B**If state B gets a 0, the last two bits input were “10”. This does not begin the

sequence, so the machine goes back to state A and waits on the next 1.

**C**If state C gets a 1, the last three bits input were “111”. It can use the last two

of these 1’s to be the first two 1’s of the sequence 11011, so the machine stays

in state C awaiting a 0. We might have something like 1111011, etc.

**D**If state D gets a 0, the last four bits input were 1100. These 4 bits are not part of

the sequence, so we start over.

**E**If state E gets a 0, the last five bits input were 11010. These five bits are not part of the

sequence, so start over.

More precisely we should be discussing prefixes and suffixes. At state C with input 111, the two bit suffix to the sequence input is 11 which is a two bit prefix of the desired sequence, so we stay at C. At E, getting a sequence 11010, we note that the 1-bit suffix is a 0, which is not a prefix of the desired sequence, the 2-bit suffix is 10, also not a prefix, etc.

Step 1e – Generate the State Table with Output

Present State Next State / Output X = 0 X = 1 A A / 0 B / 0 B A / 0 C / 0 C D / 0 C / 0 D A / 0 E / 0 E A / 0 C / 1

Step 2 – Determine the Number of Flip-Flops Required

We have 5 states, so N = 5. We solve the equation 2P-1 < 5 £ 2P by inspection, noting that it is solved by P = 3. So we need three flip-flops.

Step 3 – Assign a unique P-bit binary number (state vector) to each state.

The simplest way is to make the following assignments

A = 000 B = 001 C = 010 D = 011 E = 100

Occasionally, a better assignment can be detected by inspection of the next state table. I note that the next states in the table cluster into two disjoint sets for X = 0 and X = 1.

For X = 0 the possible next states are A and D

For X = 1 the possible next states are B, C, and E.

For this reason, I elect to give even number assignments to states A and D, and to give odd number assignments to states B, C, and E. Being somewhat traditional, I want to assign the state numbers in increasing order so that we don’t get totally confused. The assignment is

A = 000 B = 001

C = 011 Note that states 010, 110, and 111 are not used.

D = 100 E = 101

Step 4 – Generate the Transition Table With Output

Note that in many designs, such as counters, the states are already labeled with binary numbers, so the state table is the transition table. We shall label the internal state by the three bit binary number Y2Y1Y0 and use the three-bit vectors defined above.

Present State Next State / Output X = 0 X = 1 Y2Y1Y0 Y2Y1Y0 / Z Y2Y1Y0 / Z A 0 0 0 0 0 0 / 0 0 0 1 / 0 B 0 0 1 0 0 0 / 0 0 1 1 / 0 C 0 1 1 1 0 0 / 0 0 1 1 / 0 D 1 0 0 0 0 0 / 0 1 0 1 / 0

## Design mealy sequence detector to detect a sequence

1 73k views

Design mealy sequence detector to detect a sequence ----1101---- using D filpflop and logic

written 6.4 years ago by

teamques10 ★ **40k**

• modified 10 months ago

digital circuits and design

ADD COMMENT EDIT

**1 Answer**

3 4.2k views

written 6.4 years ago by

teamques10 ★ **40k**

A sequence detector is a sequential state machine. 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. The state diagram of a Mealy machine for a 1101 detector is:

The state table for the above diagram:

State assignments: Let

S 0 S0 = 00 S 1 S1 = 01 S 2 S2 = 10 S 3 S3 = 11

The above state table becomes:

Four states will require two flip flops. Consider two D flip flops. Their excitation table is shown below.

Excitation table:

K-maps to determine inputs to D Flip flop:

Circuit diagram for the sequence detector:

ADD COMMENT EDIT

can u please tell the verilog code that can be run on xilinx software as well

5.9 years ago by teamques10 ★ **40k**

Please log in to add an answer.

## Design 101 sequence detector (Mealy machine)

A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.

## Design 101 sequence detector (Mealy machine)

Difficulty Level : Medium

Last Updated : 01 Apr, 2021

Read Discuss Practice Video Courses

Prerequisite – Mealy and Moore machines

A **sequence detector** is a sequential state machine that 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 the next sequence. However, in a non-overlapping sequence detector, the last bit of one sequence does not become the first bit of the next sequence. In this post, we’ll discuss the design procedure for non-overlapping 101 Mealy sequence detectors.

**Examples:**

For non overlapping case

Input :0110101011001

Output:0000100010000

For overlapping case

Input :0110101011001

Output:0000101010000

The steps to design a non-overlapping 101 Mealy sequence detectors 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 purposes.

**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.

Guys, does anyone know the answer?