Implementation of custom counter logic in SIMULINK

六月ゝ 毕业季﹏ 提交于 2019-12-02 11:14:26

Using a Triggered and Enabled subsystem is the right approach, but your inputs (and no doubt what's inside the subsystem) needs to be modified.

Don't have any input to the subsystem (other than the trigger and enable signals).

Inside the subsystem,

  • set the enable block property to reset the state when disabled.
  • set the outport property to reset when disabled and give the initial condition as 0.
  • create a counter out of a constant (value=1), a summation and a unit delay block.
  • feed the counter into a Compare to Constant block set to the 'x' value in your question.
  • feed that block to the outport.

When enabled, the counter should count the required number of steps (when triggered) before the output goes high.

A counter logic can be implemented very easily in simulink. Take a switch,give the control input as int1. If int1 is 1 ur output shuld be 0 else take another switch give its control input as int2. if int2 is 1 ur output shuld be 1+ previous value given in feedback funit delay block

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!