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

 找回密码
 注册

手机号码,快捷登录

手机号码,快捷登录

搜帖子
查看: 3396|回复: 2

[求助] 菜鸡求助

[复制链接]
发表于 2016-10-12 00:02:32 | 显示全部楼层 |阅读模式

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

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

×
刚开始接触fpga 一个简单的计数器一直提示语法错误 希望各位能不吝赐教Error (10170): Verilog HDL syntax error at cnt_num.v(21) near text: a. Check for and fix any syntax errors that appear immediately before or at the specified keyword. The Altera Knowledge Database contains many articles with specific details on how to resolve this error. Visit the Knowledge Database at https://www.altera.com/support/s ... ge-base/search.html and search for this specific error message number.



   

        

                
  1. module cnt_num
  2. (clk,
  3. rst_n,
  4. cnt_num_out,
  5. );

  6. input clk,rst_n;

  7. output cnt_num_out;

  8. reg [27:0]cnt;

  9. reg cnt_num_out_r;

  10. always @ (posedge clk,negedge rst_n)
  11.         begin
  12.         if (!rst_n) begin
  13.                 cnt<=28'd0;
  14.                 cnt_num_out_r<=1'b0;
  15.                 end
  16.                 else if (cnt == 28'b&#8237;0010111110101111000010000000&#8236;) //此行报错
  17.                         begin
  18.                                 cnt<=1'b0;
  19.                                 cnt_num_out_r<=1'b1;
  20.                         end
  21.                                 else cnt<=cnt+1'b1;
  22.         end
  23.         
  24.         assign cnt_num_out = cnt_num_out_r;
  25. endmodule

  26.         

   

    复制代码
发表于 2016-10-12 12:07:29 | 显示全部楼层
应该是第23行错了,cnt 在 23行被写成了1bit, 年轻人,仔细点。
 楼主| 发表于 2016-10-13 21:33:15 | 显示全部楼层
回复 2# y23angchen


    嗯嗯 已经解决了 小的多谢了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-5-30 05:38 , Processed in 0.126145 second(s), 8 queries , Gzip On, Redis On.

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