aboutsummaryrefslogtreecommitdiffstats
path: root/fpga_interchange/examples/counter/counter.v
blob: 00f52a204cc09ea310f76deb9ced7fc530e62c9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module top(input clk, input rst, output [7:4] io_led);

reg [31:0] counter = 32'b0;

assign io_led = counter >> 22;

always @(posedge clk)
begin
    if(rst)
        counter <= 32'b0;
    else
        counter <= counter + 1;
end

endmodule