title: Rising or Falling Edge-Triggered Delayer for SIMULINK models
body: <p><strong>My Problem</strong></p>
  
  <p>I want to model a block called "confirmer". The specification is that the output will SIMPLY be the delayed version of input based on an edge (rising/falling). To clarify, I will try to put the timing diagrams below:</p>
  
  <pre><code>                 ___________________________ 
                  |                           |
  Input    _______|                           |____________________________
  
                 (Tdelay) _____________________
                         |                    | 
  Output   ______________|                    |____________________________
  </code></pre>
  
  <p>And</p>
  
  <pre><code>                        ____________________________
                          |                           |
  Input    _______________|                           |____________________________
                                                        (Tdelay)                           
                          ______________________________________
                          |                                     | 
  Output   _______________|                                     |_____________________
  </code></pre>
  
  <p>As I tried to draw above, the rising edge means that my output will simply follow the change input after Tdelay. But when it changes back from 1 to 0, there is no delay. This is the diagram for a confirmer block that is rising edge triggered.</p>
  
  <p>For a falling-edge triggered confirmer, it is the opposite. When there is a falling edge, the output will follow the change in input after Tdelay seconds i.e. hold the last input for Tdelay.</p>
  
  <p><strong>My Target Platform</strong></p>
  
  <p>SIMULINK and MATLAB.</p>
  
  <p><strong>My initial solution</strong></p>
  
  <p>I know that there is way to trigger for certain actions by using a triggered subsystem block. But I am struggling to use the delay/unit-delay block in SIMULINK to implement the delay with the trigger. I have managed to use another block called resettable delayer but it does not work properly when it is a rising-edge reset; it simply resets based on an edge.</p>
  
  <p>Has anyone tried this kind of problem before? </p>
  
  <p><strong>Update since @PhilGoddard's answer</strong></p>
  
  <p><img src="https://i.stack.imgur.com/Of7uK.jpg" alt="enter image description here"></p>
  
  <p>I think this should work as I have managed to reproduce the timing diagrams in the question. </p>
  
  <p>How I designed it:</p>
  
  <p>1) Used the repeating sequence stair as my input.</p>
  
  <p>2) configured the unit delay block such that the reset is enabled at rising edge or fallling edge. This will allow either of the following"</p>
  
  <p>i) Input (falling edge) = Output (falling edge) [rising edge is delayed by Tdelay
     ii) input (rising edge) = Output (rising edge) [failling edge is delayed by Tdelay]</p>
  
  <p>Unless I am losing my marbles, I think that this solution is okay?</p>