This Verilog project implements a Finite State Machine (FSM) to detect the serial input sequence 1101.
seq_det1.v: FSM module for sequence detection.seq_det_tb.v: Testbench to simulate the sequence and check output.- Clock toggles every 5ns (
#5), and the input stream is provided serially.
The FSM uses 4 states:
- S0 → S1 on
1 - S1 → S2 on
1 - S2 → S3 on
0 - S3 → S0 on
1(and setsout = 1)
Overlapping sequences are supported.
You can simulate using ModelSim, Vivado, or any Verilog simulator.
outgoes HIGH after detecting the sequence1101.