+/EE316
digital logic
git clone https://git.julia.blue/+/EE316
91885ad
master
1module clkdiv #( parameter DIVISOR = 5 ) 2( input clk , output reg clk_out = 0 ); 3reg [ 19 : 0 ] counter = 0 ; 4always @( posedge clk ) begin 5if ( counter == DIVISOR - 2'b01 ) begin 6clk_out = ~ clk_out ; 7counter = 0 ; 8end else counter = counter + 1 ; 9end 10endmodule