在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 12720|回复: 7

[求助] 这个错误什么意思

[复制链接]
发表于 2013-3-20 19:52:10 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
本帖最后由 txws007 于 2013-3-21 19:27 编辑

下面是我的代码,一运行就出现Error (10200): verilog hdl Conditional Statement error at test2.v(34): cannot match operand(s) in the condition to the corresponding edges in the enclosing event control of the always construct这个错误,这是什么意思?

module hm(clk,rst_n,data,pulse,key/*,load*/);

input clk,rst_n,key;

input [7:0] data;

output pulse/*,load*/;

reg [7:0] count;

reg pulse;

reg clk_1;

reg [4:0] a;

always @(posedge clk or negedge rst_n)

  begin

   if(~rst_n)

     begin


          clk_1=0;


          a<=5'd0;


        end


      else


        if(a==5'd16)


          begin



            a<=5'd0;


            clk_1=~clk_1;


          end


         else


           a<=a+5'd1;

   end

always @(posedge clk_1 or negedge rst_n)

  begin


       if(~rst_n)


         begin


           count<=0;


           pulse<=0;


         end


       else


         count<=data;


           if(key==0)


              begin


                pulse<=1;


                count<=count-8'd1;



                  if(count==8'd0)


                    begin


                      pulse<=0;


                      count<=8'd0;


                         if(pulse==0)


                           begin


                             count<=data;


                           end


                     end


                end

   end

endmodule

发表于 2013-3-20 22:20:39 | 显示全部楼层
最好把行号也标上,比较好找错误!
发表于 2013-3-21 01:54:51 | 显示全部楼层
else


count<=data;


if(key==0)

这里的else后面缺了一个begin.
发表于 2013-3-21 10:14:05 | 显示全部楼层
你得把代码格式规范下,根据报错行数和报错内容找问题。
 楼主| 发表于 2013-3-21 19:24:32 | 显示全部楼层
回复 4# rdl890208


    你好,这个报错的地方是34行,if(key==0)的这个语句
发表于 2013-3-22 19:29:59 | 显示全部楼层
else 下面少了begin...end  建议代码规范
发表于 2018-8-7 13:22:53 | 显示全部楼层
It is good! Thanks for the sharing!
发表于 2018-8-7 13:24:55 | 显示全部楼层
It is good! Thanks for the sharing!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /2 下一条

×

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-5-22 13:15 , Processed in 0.025866 second(s), 6 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表