How to reset counter using its own output counter complete signal??
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have implemented counter logic in simulink with reset & counter complete signal. When I give reset externally logic functions very well. but my requirement is as soon as counter completes target time, it should get reset and starts counting again i.e. cyclic process. without requirement of external reset. So I took counter complete output & feed it back to reset. but it is giving algebric loop error. How to reset counter using its own output counter complete signal??. plz reply its urgent
Respuestas (1)
Tejas
el 24 de Sept. de 2024
Hello Pranjali,
From the above question, I am assuming that you want to build a counter that automatically resets after reaching its upper limit.
Here are the steps to achieve this:
- Add a Unit Delay block with an initial condition of 0. This block stores the current input at any given time and outputs the previous input. The output of this block will represent the current counter value. For more details on this block, refer to this documentation: https://www.mathworks.com/help/simulink/slref/unitdelay.html .
- Include an Add block that takes inputs from the Unit Delay block and a Constant block with a value of 1.
- Add a Compare To Constant block to receive input from the Add block and check if the count has reached its upper limit.
- Use a Switch block that takes control input from the Compare To Constant block. This block forwards the output of the Add block if the condition is met, otherwise it sends a reset signal.
- Connect the output of the Switch block to the Unit Delay block.
Below is a screenshot of the model:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1778080/image.png)
Here is a screenshot of the expected output:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1778085/image.png)
0 comentarios
Ver también
Categorías
Más información sobre Measurements and Statistics en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!