`timescale 1ns/1ns module sequence_detect( input clk, input rst_n, input a, output reg match ); reg[2:0] p; reg match1; always@(posedge clk or negedge rst_n)begin if(!rst_n)begin match<=0; match1<=0; end else begin match<=0; casez({a,p,match1}) 5'b00000:p<=3'b001; 5'b10010:p<=3'b010; ...