[verilog] 语法报错!always敏感信号对其内部if语句的影响?

[复制链接]
 楼主| a2582006460 发表于 2014-6-10 19:44 | 显示全部楼层 |阅读模式
always@(negedge clk_100ms , negedge rest)
begin
        if(EN==0)       
                LED<=LED+1;
        if(rest==0)
                LED<=0;
end

我的EN又不是敏感信号怎么还会有这样的错误?

Error (10200): Verilog HDL Conditional Statement error at couter.v(27): cannot match operand(s) in the condition to the corresponding edges in the enclosing event control of the always construct
ococ 发表于 2014-6-10 20:27 | 显示全部楼层
基本语法。找本书看看范例吧
luyaker 发表于 2014-6-11 12:11 | 显示全部楼层

always@(posedge clk_100ms or negedge reset)
begin
    if(!reset)
           LED<=0;
  else if(EN==0)        
          LED<=LED+1;
end
leungmao 发表于 2014-6-11 14:18 | 显示全部楼层
楼主可以看看标准的异步复位的写法
habc987 发表于 2014-6-22 20:12 | 显示全部楼层
luyaker 发表于 2014-6-11 12:11
always@(posedge clk_100ms or negedge reset)
begin
    if(!reset)

正解
 楼主| a2582006460 发表于 2014-6-24 17:09 | 显示全部楼层
刚刚入门,现在终于懂了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

28

主题

150

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部

28

主题

150

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部