Skip to content

VLSIFacts

Let's Program the Transistors

  • Home
  • DHD
    • Digital Electronics
    • Fault Tolerant System Design
    • TLM
    • Verification
    • Verilog
    • VHDL
    • Xilinx
  • Embedded System
    • 8085 uP
    • 8086 uP
    • 8051 uC
  • VLSI Technology
    • Analog Electronics
    • Memory Devices
    • VLSI Circuits
  • Interview
    • Interview Experience
    • Training Experience
    • Question Bank
  • Notifications
  • QUIZ
  • Community
  • Job Board
  • Contact Us

State Machine Diagram for Pattern Recognition / Sequence Detector

Posted on February 4, 2016June 17, 2025 By vlsifacts No Comments on State Machine Diagram for Pattern Recognition / Sequence Detector

Sequence Detector is a digital system which can detect/recognize a specified pattern from a stream of input bits.

Sequence Detector Conceptual Diagram

Let’s say the Sequence Detector is designed to recognize a pattern “1101”. Consider input “X” is a stream of binary bits. When the Sequence Detectors finds consecutive 4 bits of input bit stream as “1101”, then the output becomes “1” [O = 1], otherwise output would be “0” [O = 0].

Let’s design the Mealy state machine for the Sequence Detector for the pattern “1101”.

Define 4 states

  • S0: No match till time ‘t’
  • S1: 1-bit match till time ‘t’
  • S2: 2-bit match till time ‘t’
  • S3: 3-bit match till time ‘t’

The state machine diagram would be as follows:

Mealy machine of 1101 Sequence Detector
Mealy machine of “1101” Sequence Detector

Now let’s understand how we get the transitions and corresponding outputs: Keep in mind that we will move from left to right that means from LSB towards MSB

Let’s say we are at the initial state S0: No bit matched yet

for input “0”: Since the 1st bit of the pattern to be matched is “1” [LSB], so again no bit match. Hence the next state will be “S0” and the output will be “0” as the whole pattern has not been matched yet.

for input “1”: Since the 1st bit of the pattern is matched, the next state will be “S1”. But the output will be still “0” as the whole pattern has not been matched yet.

Let’s say we are at the state S1: 1st bit already matched, That means LSB “1” of the pattern “1101” already received

for input “0”: Since the “1” had been already received, now a “0” will make the sequence as “01”. So 2 bit matching, hence the next state will be “S2” and the output would be “0” as the whole pattern has not been matched yet.

for input “1”: Since the “1” had been already received, now a “1” will make the sequence as “11”. So no 2 bit matching but we can consider the recently received “1” as the 1st bit matching of a newly considered pattern “1101”. So the next state would be the same “S1” and the output will be “0”.

Let’s say we are at the state S2: 2 bits already matched, That means “01” of the pattern “1101” already received

for input “0”: Since the “01” had been already received, now a “0” will make the sequence as “001”. So pattern matching failed. Hence the next state will be “S0” and output will be “0”.

for input “1”: Since the “01” had been already received, now a “1” will make the sequence as “101”. So 3 bit matching. Hence the next state would be “S3” and the output will be “0” as no complete pattern matching yet.

Let’s say we are at the state S3: 3 bits already matched, That means “101” of the pattern “1101” already received

for input “0”: Since the “101” had been already received, now a “0” will make the sequence as “0101”. So pattern matching failed, but we can consider the recently received “01” as the 2 bit matching of a newly considered pattern “1101”. Hence the next state will be “S2” and output will be “0”.

for input “1”: Since the “101” had been already received, now a “1” will make the sequence as “1101”. So the whole pattern got matched. Hence the output will be “1” and the next state would be “S1” as we can consider the recently received “1” as the 1st bit matching of a newly considered pattern “1101”.


Check the circuit design of the above state machine diagram @ Circuit Design of a Sequence Detector

Spread the Word

  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on X (Opens in new window) X
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to email a link to a friend (Opens in new window) Email
  • Click to print (Opens in new window) Print

Like this:

Like Loading...

Related posts:

  1. Circuit Design of a Sequence Detector
  2. State Machine Diagram for Parity Generator
  3. Mealy Vs. Moore Machine
  4. Circuit Design of Parity Generator
DHD, Digital Electronics Tags:FSM Design, Mealy Machine, Pattern Matching, Sequence Detector, State Machine Diagram, State Transition Diagram

Post navigation

Previous Post: State Machine Synthesis
Next Post: Circuit Design of a Sequence Detector

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Top Posts & Pages

  • ASCII Code
  • Circuit Design of a 4-bit Binary Counter Using D Flip-flops
  • NAND and NOR gate using CMOS Technology
  • Texas Instruments Question Bank Part-1
  • AND and OR gate using CMOS Technology

Copyright © 2025 VLSIFacts.

Powered by PressBook WordPress theme

Subscribe to Our Newsletter

%d