make better
This commit is contained in:
parent
fdd6553f11
commit
f2c0935b60
128 changed files with 39530 additions and 530 deletions
21
downclocker.sv
Normal file
21
downclocker.sv
Normal file
|
@ -0,0 +1,21 @@
|
|||
module downclocker #(parameter DC_BITS = 21) (
|
||||
input wire clk_in,
|
||||
output logic clk_out
|
||||
);
|
||||
|
||||
logic [DC_BITS-1:0] counter;
|
||||
|
||||
initial begin
|
||||
counter = 0;
|
||||
clk_out = 0;
|
||||
end
|
||||
|
||||
always_ff @(posedge clk_in) begin
|
||||
if (counter[DC_BITS-1] == 1) begin
|
||||
clk_out <= !clk_out;
|
||||
counter <= 0;
|
||||
end else begin
|
||||
counter <= counter + 1;
|
||||
end
|
||||
end
|
||||
endmodule
|
Loading…
Add table
Add a link
Reference in a new issue