mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-27 10:55:51 +00:00
initial import
This commit is contained in:
commit
7764d0ba1d
481 changed files with 54634 additions and 0 deletions
27
tests/asicworld/code_hdl_models_clk_div.v
Normal file
27
tests/asicworld/code_hdl_models_clk_div.v
Normal file
|
@ -0,0 +1,27 @@
|
|||
//-----------------------------------------------------
|
||||
// Design Name : clk_div
|
||||
// File Name : clk_div.v
|
||||
// Function : Divide by two counter
|
||||
// Coder : Deepak Kumar Tala
|
||||
//-----------------------------------------------------
|
||||
|
||||
module clk_div (clk_in, enable,reset, clk_out);
|
||||
// --------------Port Declaration-----------------------
|
||||
input clk_in ;
|
||||
input reset ;
|
||||
input enable ;
|
||||
output clk_out ;
|
||||
//--------------Port data type declaration-------------
|
||||
wire clk_in ;
|
||||
wire enable ;
|
||||
//--------------Internal Registers----------------------
|
||||
reg clk_out ;
|
||||
//--------------Code Starts Here-----------------------
|
||||
always @ (posedge clk_in)
|
||||
if (reset) begin
|
||||
clk_out <= 1'b0;
|
||||
end else if (enable) begin
|
||||
clk_out <= !clk_out ;
|
||||
end
|
||||
|
||||
endmodule
|
Loading…
Add table
Add a link
Reference in a new issue