2021-02-26 01:11:32 +08:00
|
|
|
module top(input clk, input rst, output [7:4] io_led);
|
|
|
|
|
2021-06-10 18:41:47 +08:00
|
|
|
localparam SIZE = 32;
|
2021-02-26 01:11:32 +08:00
|
|
|
|
2021-06-10 18:41:47 +08:00
|
|
|
reg [SIZE-1:0] counter = SIZE'b0;
|
|
|
|
|
|
|
|
assign io_led = {counter[SIZE-1], counter[25:23]};
|
2021-02-26 01:11:32 +08:00
|
|
|
|
|
|
|
always @(posedge clk)
|
|
|
|
begin
|
|
|
|
if(rst)
|
2021-06-10 18:41:47 +08:00
|
|
|
counter <= SIZE'b0;
|
2021-02-26 01:11:32 +08:00
|
|
|
else
|
|
|
|
counter <= counter + 1;
|
|
|
|
end
|
|
|
|
|
|
|
|
endmodule
|