title: How to start a counter using a one clock pulse enable
body: <p>So I'm trying to implement a counter that takes a one-clock-cycle enable and starts counting from there. It sends a one-clock-cycle expired once the counter finishes counting. The enable will never be sent again until the counter is done counting, and the value input is continuous.</p>
  
  <p>I was thinking of just using a reg variable that is changed to high when enable = 1, and changed to low once the counter finishes counting. I fear this may imply latches that I don't want... is there a better way to do this?</p>
  
  <p>current code:</p>
  
  <pre><code>module Timer(
  input [3:0] value,
  input start_timer,
  input clk,
  input rst,
  output reg expired
  );
  
  //counter var
  reg [3:0] count;
  
  //hold variable
  reg hold;
  
  //setting hold
  always @*
  begin
      if (start_timer == 1'b1)
           hold &lt;= 1'b1;
  end
  
  
  //counter
  if (hold == 1'b1)
  begin
  always @ (posedge(clk))
  begin
      if(count == value - 1)
      begin
          expired &lt;= 1'b1;
          count &lt;= 4'b0;
          hold &lt;= 1'b0;
      end
      else
          count &lt;= count + 1'b1;
  end
  end
  
  endmodule
  </code></pre>