//希望大家留下自己的想法,互相学习啊
reg [2:0] shifter;
input pink;
output pink_out;
reg pink_out;
always @(posedge clk)
begin
shifter[2:1]<=shifter[1:0];
shifter[0]<=pink;
end
always @(posedge clk)
begin
if(shifter[2:0]==3'b000)
pink_out<=1'b0;
else if(shifter[2:0]==3'b111)
pink_out<=1'b1;
else
pink_out<=pink_out;
end
文章评论(0条评论)
登录后参与讨论