title: Implementation of custom counter logic in SIMULINK
body: <p>I am trying to implement a counter logic in SIMULINK where</p>
  
  <pre><code>in1, in2 are inputs
  
  out1 is the output
  
  if in2 = 0, out1 = 0;
  
  if in2 = 1, out1 = 1 after x high edges of in1
  </code></pre>
  
  <p>I have tried using "Detect Rise Positive" block but failed miserably because I don't have sufficient experience of implementing a timing diagram correctly in SIMULINK. Could anyone kindly point me to the right direction?</p>
  
  <p><strong>Update</strong></p>
  
  <p>An approach I have taken since I posted this question is the "Triggered and enabled subsystem". I am trying to set it up so that:</p>
  
  <pre><code>in2 becomes the enable signal
  in1 becomes the trigger
  in2 becomes the intput to the subsystem
  Out1 becomes the output of the subsystem
  </code></pre>
  
  <p>But I think that the above was rubbish. Unfortunately it is not VHDL where I could have implemented it using 4-5 lines of description of the hardware logic. </p>