1010 Sequence Detector Moore State Diagram

Last time, I presented a Verilog code together with Testbench for Sequence Detector using FSM. The sequence being detected was '1011'.

The state diagram for a Moore machine or Moore diagram is a diagram that associates an output value with each state. Moore machine is an output producer. Relationship with Mealy machines. As Moore and Mealy machines are both types of finite-state machines, they are equally expressive: either type can be used to parse a regular language. Design an FSM for serial sequence detector with the pattern '0110' with non-overlapping. Use Mealy Machine. Answer: Four states. A (no 0 detected state), b (one 0 detected state), c (01 detected state), and d (011 detected state). The state transition or flow diagram for the non-overlapping case will be.

This VHDL project presents a full VHDL code for Moore FSM Sequence Detector. A VHDL Testbench is also provided for simulation. The sequence to be detected is '1001'.

  • Figure 3: State diagram for „1010‟ sequence detector using Mealy machine (with overlapping) The Verilog implementation of this FSM can be found in Verilog file in the download section. Moore based sequence detector The same „1010‟ sequence detector is designed also in Moore machine to show the differences.
  • The sequence detector (a) Moore representation state diagram (b) Timing diagrams (c) State table and flip-flop inputs tabulation (d) K-map plots for D A and D B (e) Circuit implementation The state table and the tabulation of the flip-flop inputs for the Moore circuit are shown in Figure 8.9(c) and the K-map plots for the D flip-flops are shown.
  • If you check the code you can see that in each state we go to the next state depending on the current value of inputs.So this is a mealy type state machine. The testbench code used for testing the design is given below.It sends a sequence of bits ' to the module.

Sequence Detector Examples

The Moore FSM state diagram for the sequence detector is shown in the following figure.

VHDL code for Moore FSM Sequence Detector is designed based on Moore FSM's state diagram and block diagram:

VHDL Testbench for Sequence Detector using Moore FSM:

Simulation Waveform for Moore FSM Sequence Detector in VHDL:

As shown in the simulation waveform of the VHDL Moore FSM sequence detector, the detector output only goes high when the sequence '1001' is detected.
Verilog code for Moore FSM Sequence Detector: here.
Recommended VHDL projects:
1. What is an FPGA? How VHDL works on FPGA
2. VHDL code for FIFO memory
3. VHDL code for FIR Filter
4. VHDL code for 8-bit Microcontroller
5. VHDL code for Matrix Multiplication
6. VHDL code for Switch Tail Ring Counter
7. VHDL code for digital alarm clock on FPGA
8. VHDL code for 8-bit Comparator
9. How to load a text file into FPGA using VHDL
10. VHDL code for D Flip Flop
11. VHDL code for Full Adder
12. PWM Generator in VHDL with Variable Duty Cycle
13. VHDL code for ALU
14. VHDL code for counters with testbench
15. VHDL code for 16-bit ALU
16. Shifter Design in VHDL
17. Nonlinear Lookup Table Implementation in VHDL
18. Cryptographic Coprocessor Design in VHDL
20. VHDL Code for Clock Divider on FPGA
21. Generate clock enable signal in VHDL
22. VHDL code for debouncing buttons on FPGA
23. VHDL code for Traffic light controller
24. VHDL code for a simple 2-bit comparator

1010 Sequence Detector Moore State Diagram Example

25. VHDL code for a single-port RAM
26. VHDL code for Car Parking System using FSM
27. VHDL coding vs Software Programming
28. VHDL code for MIPS Processor
29. VHDL code for Moore FSM Sequence Detector
30. VHDL code for Seven-Segment Display on Basys 3 FPGA