集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
查看: 1003|回复: 0

modesim 连调的问题

[复制链接]
ywhfdl 发表于 2012-4-14 15:14:25 | 显示全部楼层 |阅读模式
//counter.v
module counter(clk,rst,counter_out);
input clk;
input rst;
output [3:0] counter_out;
reg [3:0] counter_out;
initial begin counter_out=0; end
always @(posedge clk or negedge rst)
  if(!rst)
    counter_out <= 0;
  else
    counter_out <=counter_out+1'b1;
endmodule

我的这个代码,通过quartuse 与modesim 连调的时候,CLK 一直没有变化,后来我force clk 0 0,1 50 -r 100这样,才会有CLK,但是counter_out 一直不计数,后来,我加上了
initial begin counter_out=0; end
counter_out 才开始计数的,
这个是为什么呢??请教各位大虾了!!
您需要登录后才可以回帖 登录 | 我要注册

本版积分规则

关闭

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

QQ|小黑屋|手机版|Archiver|fpga论坛|fpga设计论坛 ( 京ICP备20003123号-1 )

GMT+8, 2025-6-25 15:48 , Processed in 0.075402 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表