宁德市城乡建设局网站,书画院网站源码,wordpress开发网站,淘宝运营学习专栏前言 本专栏的内容主要是记录本人学习Verilog过程中的一些知识点#xff0c;刷题网站用的是牛客网 读入数据移位寄存#xff0c;寄存后的数据与序列数做对比#xff0c;相等则flag为1#xff0c;不等则为0 timescale 1ns/1nsmodule sequence_test2(input wire clk ,in… 专栏前言 本专栏的内容主要是记录本人学习Verilog过程中的一些知识点刷题网站用的是牛客网 读入数据移位寄存寄存后的数据与序列数做对比相等则flag为1不等则为0 timescale 1ns/1nsmodule sequence_test2(input wire clk ,input wire rst ,input wire data ,output reg flag
);
//*************code***********//reg [3:0] lock ; always (posedge clk or negedge rst) begin if (~rst) lock d0 ; else lock {lock[2:0], data} ; endalways (posedge clk or negedge rst) begin if (~rst) flag d0 ; else if (lock[3:0] 4b1011) flag 1d1 ; else flag d0 ; end//*************code***********//
endmodule