blob: 68b5c05b6fd364a02d3e88b4784910607c71505b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
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
|