1
0
forked from tanchou/Verilog
This commit is contained in:
Gamenight77
2025-05-02 15:51:18 +02:00
parent 0faab53c30
commit f5e73d7379
105 changed files with 707398 additions and 1 deletions

View File

@@ -0,0 +1,34 @@
`timescale 1ns/1ps
`default_nettype none
module blink #(
parameter CLK_SPEED = 27_000_000
)
(
input wire clk,
output reg led
);
wire strobe;
localparam ONE_HALF_S = CLK_SPEED / 2;
localparam ONE_S = CLK_SPEED ;
localparam TWO_S = CLK_SPEED *2;
localparam TIME = TWO_S;
localparam TIME_WIDTH = $clog2(TIME);
initial led = 0;
counter #(.WIDTH(TIME_WIDTH), .INITIAL_VALUE(TIME)) counter_inst
(
.clk(clk),
.reset(1'b0),
.en(1'b1),
.strobe(strobe)
);
always_ff @(posedge clk)
if(strobe) led <= !led;
endmodule