How to Design Sequence Detectors: Steps & Example

An error occurred trying to load this video.

Try refreshing the page, or contact customer support.

Coming up next: Asynchronous Sequential Circuits: Definition & Benefits

You're on a roll. Keep up the good work!

Take Quiz Watch Next Lesson
Your next lesson will play in 10 seconds
  • 0:04 Sequence Detectors
  • 1:17 Design of a Sequence Detector
  • 5:01 Lesson Summary
Save Save Save

Want to watch this again later?

Log in or sign up to add this lesson to a Custom Course.

Log in or Sign up

Speed Speed
Lesson Transcript
Instructor: Shadi Aljendi

Shadi has a Ph.D. in Computer Science and more than 20 years experience in industry and higher education.

Have you ever used a digital code to open a lock or a door? Do you use, or know someone who uses, a security alarm that beeps when unauthorized people try to enter a building? These are examples of circuits that can be built using basic sequence detector design concepts. We will learn about this in this lesson.

Sequence Detectors

A sequence detector is a sequential circuit that outputs 1 when a particular pattern of bits sequentially arrives at its data input. The figure below shows a block diagram of a sequence detector. It has two inputs and one output. The inputs are the clock used to synchronize the functionality of the circuit and the data input.

Figure 1: A block diagram of a sequence detector with sample input and output
block diagram of a sequence detector with input and output

The data input receives the input sequence. In our figure, the input sequence and the output sequence of the circuit are a sample of a 0111 sequence detector. If you follow the input and output sequences, you can see that only when the last four bits of the input sequence are 0111 does the output turn to 1 during one clock cycle. It then turns back to 0.

The sequence detectors that we cover in this lesson do not reset their states after each detection. In other words, they memorize the input sequence before the detection of the required pattern and use it to redetect the pattern. For example, if the input of a 1111 sequence detector is 11111111, the output will be 00011111. The sequence detector keeps the previously detected 1s to use in the following detections of 1111.

Design of a Sequence Detector

In this lesson, we will use Moore state machines. Moore machines are state machines where the outputs are states and are not directly determined by the inputs. In other words, inputs only cause a state transfer, which might or might not be an output state. In a Moore state diagram, a state is assigned the following values:

  • the state's name
  • the states value, which is 0 or 1
  • the state's code

Let's design a sequence detector that would detect the sequence 0111. We start with an initial state, called Init, as shown in this next figure. At this point, you can consider this state as the state of the circuit when it starts. The circuit at this point has not gotten any values on its data input. The name of the state is Init, its value is 0, and its code is 000. We are coding the state using three bits because we will need five states to design this circuit. You can leave the coding phase until the end of the design, if you do not know the number of required states.

Figure 2: Step 1 of the design of the state diagram for the sequence detector 0111
sequence detector state diagram 1

Starting from this point, based on data input values, we will add new states as needed. As shown in this next figure, we have two possibilities for the input: 0 or 1. We can see here that as long as the detector is receiving 1s, it stays in the same Init state. This is indicated by the transfer from the state Init to itself with a transfer condition 1. If the input (transfer condition) is 0, then we can move forward toward a new state that describes the detection of one of the bits of the required pattern.

Figure 3: Step 2 of the design of the state diagram for the sequence detector 0111
sequence detector state diagram 2

We again have two input possibilities. Here, as long as the detector is receiving 0s, it stays in the same 'Received 0' state. However, if the input receives a 1, then another bit of the pattern is detected and we can move to a new state, named Received01, that indicates this event, as shown in this next figure:

Figure 4: Step 3 of the design of the state diagram for the sequence detector 0111
sequence detector state diagram 3

At this point, if the circuit receives 0, it needs to get back to the Recieved0 state, as this will break the required sequence. If it receives 1, it will move to a new state, which is Recieved011, as shown in this next figure:

Figure 5: Step 4 of the design of the state diagram for the sequence detector 0111
sequence detector state diagram 4

To unlock this lesson you must be a Member.
Create your account

Register to view this lesson

Are you a student or a teacher?

Unlock Your Education

See for yourself why 30 million people use

Become a member and start learning now.
Become a Member  Back
What teachers are saying about
Try it risk-free for 30 days

Earning College Credit

Did you know… We have over 200 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

Create an account to start this course today
Try it risk-free for 30 days!
Create an account