题解 | #含有无关项的序列检测#
含有无关项的序列检测
http://www.nowcoder.com/practice/cba67d06d6834a5d9b93e1087b56c8d8
reg [8:0] list;
always@(posedge clk ,negedge rst_n)
if(!rst_n)
begin
list <= 9'd0;
end
else
list <= {list[7:0],a};
always@(posedge clk ,negedge rst_n)
if(!rst_n)
begin
match <= 0;
end
else
casex(list)
9'b011xxx110:match <= 1;
default:match <= 0;
endcase