打印

状态机描述

[复制链接]
1365|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
blairstar|  楼主 | 2011-11-17 13:36 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
大家好,小弟刚在学习状态机的VHDL建模,看到一例子,状态转移图如下:
file:///C:/Documents
下面VHDL的描述:
type state is (step1, step2, step3);
signal current_state, next_state : state;

STATE_REG : process(clk) is
begin
  if rising_edge(clk) then
   if reset = '1' then
    current_state <= step1;
   else
    current_state <= next_state;
   end if;
  end if;
end process STATE_REG;

NEXT_STATE_REG : process (start) is
begin
  case current_state is
   when step1 =>
    if start = '0' then
     next_state <= step1;
    else
     next_state <= step2;
    end if;
   when step2 =>
    next_state <= step3;
   when step3 =>
    next_State <= step1;
  end case;
end process NEXT_STATE_REG;

对这个例子有一个疑问,为什么进程NEXT_STATE_REG 需要加入start敏感信号量,我记得进程是只有敏感信号量变化才会启动执行的,但事实上,在状态2到状态3的转化,并不需要敏感信号量start变化,这是为什么呢?

相关帖子

沙发
沙河小菜鸟| | 2012-12-22 20:55 | 只看该作者
if start = '0' then
     next_state <= step1;
     else
      next_state <= step2;
     end if;

这里不就用的start么???
这个只是控制状态一的;
状态2,3的变化是有case语句的。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

0

主题

2

帖子

0

粉丝