mirror of
https://github.com/chipsalliance/f4pga-examples.git
synced 2025-01-03 03:43:38 -05:00
8ae95b0d8d
Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
19 lines
336 B
Verilog
19 lines
336 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
|