HDLbits——Exams/m2014 q4k
作者:互联网
//四级移位寄存器
module top_module (
input clk,
input resetn, // synchronous reset
input in,
output reg out);
reg [2:0] Q;
always @(posedge clk)begin
if(~resetn)begin
{Q,out} <= 4'b0;
end
else begin
Q[2] <= in;
Q[1] <= Q[2];
Q[0] <= Q[1];
out <= Q[0];
end
end
endmodule
标签:begin,m2014,resetn,clk,module,reg,Exams,input,q4k 来源: https://www.cnblogs.com/waqdgstd/p/15233565.html