module TEST_LED2(clk1,led);
input clk1;
output[5:0]led;
reg[5:0]led;
reg[2:0]status;
reg[25:0]buffer;
always@(posedge clk1)
begin
buffer<=buffer+1'b1;
if(buffer==25'b1_0111_1101_0111_1000_0100_0000)
begin
buffer<=0;
status<=status+1'b1;
if(status==3'd5)
status<=0;
end
end
always@(posedge clk1)
begin
case(status)
3'd0:led<=6'b111110;
3'd1:led<=6'b111101;
3'd2:led<=6'b111011;
3'd3:led<=6'b110111;
3'd4:led<=6'b101111;
3'd5:led<=6'b011111;
endcase
end
endmodule
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>