My Problem
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:
___________________________
| |
Input _______| |____________________________
(Tdelay) _____________________
| |
Output ______________| |____________________________
And
____________________________
| |
Input _______________| |____________________________
(Tdelay)
______________________________________
| |
Output _______________| |_____________________
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.
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.
My Target Platform
SIMULINK and MATLAB.
My initial solution
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.
Has anyone tried this kind of problem before?
Update since @PhilGoddard's answer
I think this should work as I have managed to reproduce the timing diagrams in the question.
How I designed it:
1) Used the repeating sequence stair as my input.
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"
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]
Unless I am losing my marbles, I think that this solution is okay?