`timescale 1ns/1ns module sequence_detect( input clk, input rst_n, input a, output reg match ); parameter IDLE = 1'b0,S1 = 1'b1,S2 = 2'b10,S3 = 2'b11; parameter SX_1 = 3'b100,SX_2 = 3'b101,SX_3 = 3'b110; reg [2:0] current_state,next_state; reg match_change; // always@(posedge clk or negedge ...