yosys/techlibs/cmos/counter.v

13 lines
219 B
Coq
Raw Normal View History

2013-09-14 11:23:45 +02:00
module counter (clk, rst, en, count);
input clk, rst, en;
output reg [3:0] count;
always @(posedge clk)
if (rst)
count <= 4'd0;
else if (en)
count <= count + 4'd1;
endmodule