f4pga-examples/xc7/counter_test/counter.v
Ryan Johnson 9b953d9f75 formatted files
Signed-off-by: Ryan Johnson <ryancj14@gmail.com>
2021-05-13 12:07:40 -06:00

22 lines
332 B
Verilog

module top (
input clk,
output [3:0] led
);
localparam BITS = 4;
localparam LOG2DELAY = 22;
wire bufg;
BUFG bufgctrl (
.I(clk),
.O(bufg)
);
reg [BITS+LOG2DELAY-1:0] counter = 0;
always @(posedge bufg) begin
counter <= counter + 1;
end
assign led[3:0] = counter >> LOG2DELAY;
endmodule