mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			12 lines
		
	
	
	
		
			216 B
		
	
	
	
		
			Verilog
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
	
		
			216 B
		
	
	
	
		
			Verilog
		
	
	
	
	
	
module counter (clk, rst, en, count);
 | 
						|
 | 
						|
   input clk, rst, en;
 | 
						|
   output reg [2:0] count;
 | 
						|
 | 
						|
   always @(posedge clk)
 | 
						|
      if (rst)
 | 
						|
         count <= 3'd0;
 | 
						|
      else if (en)
 | 
						|
         count <= count + 3'd1;
 | 
						|
 | 
						|
endmodule
 |