2020-04-20 11:02:06 -04:00
|
|
|
module top (
|
|
|
|
input clk,
|
2020-06-10 04:03:21 -04:00
|
|
|
output [3:0] led
|
2020-04-20 11:02:06 -04:00
|
|
|
);
|
|
|
|
|
|
|
|
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
|