用户登录  |  用户注册
首 页商业源码原创产品编程论坛
当前位置:PB创新网文章中心解决方案电子通信

用STATECAD快速设计有限状态机

减小字体 增大字体 作者:佚名  来源:本站整理  发布时间:2009-01-10 22:25:48

     next_sreg<=OFF;  next_POWERLED<='0';
     next_PLAYLED<='0'; next_RECORDLED<='0';
    END IF;
    IF ( STOPSWITCH='1' AND POWERSWITCH='1' ) THEN
     next_sreg<=POWERON; next_POWERLED<='1';
     next_PLAYLED<='0'; next_RECORDLED<='0';
    END IF;
   WHEN POWERON =>
    IF ( POWERSWITCH='0' ) THEN
     next_sreg<=OFF;  next_POWERLED<='0';
     next_PLAYLED<='0'; next_RECORDLED<='0';
    ELSIF ( RECORDSWITCH='1' ) THEN
     next_sreg<=RECORDING; next_POWERLED<='1';
     next_PLAYLED<='0';  next_RECORDLED<='1';
    ELSIF ( PLAYSWITCH='1' ) THEN
     next_sreg<=PLAY;     next_POWERLED<='1';
     next_PLAYLED<='1';  next_RECORDLED<='0';
     ELSE
     next_sreg<=POWERON;  next_POWERLED<='1';
     next_PLAYLED<='0';  next_RECORDLED<='0';
    END IF;
   WHEN RECORDING =>
    IF ( POWERSWITCH='1' AND STOPSWITCH='0' ) THEN
     next_sreg<=RECORDING; next_POWERLED<='1';
     next_PLAYLED<='0';  next_RECORDLED<='1';
    END IF;
    IF ( POWERSWITCH='0' ) THEN
     next_sreg<=OFF;   next_POWERLED<='0';
     next_PLAYLED<='0';  next_RECORDLED<='0';
    END IF;
    IF ( STOPSWITCH='1' AND POWERSWITCH='1' ) THEN
     next_sreg<=POWERON;  next_POWERLED<='1';
     next_PLAYLED<='0';  next_RECORDLED<='0';
    END IF;
   WHEN OTHERS =>
  END CASE;
 END PROCESS;
END BEHAVIOR;

整个状态机实现过程比相当简单。快捷。有效。




上一页  [1] [2] 

Tags:

作者:佚名

文章评论评论内容只代表网友观点,与本站立场无关!

   评论摘要(共 0 条,得分 0 分,平均 0 分) 查看完整评论
PB创新网ourmis.com】Copyright © 2000-2009 . All Rights Reserved .
页面执行时间:25,375.00000 毫秒
Email:ourmis@126.com QQ:2322888 蜀ICP备05006790号