找回密码
 注册
搜索
查看: 612|回复: 2

[讨论] 求教!

[复制链接]
发表于 2006-10-16 12:33:00 | 显示全部楼层 |阅读模式
写了一段verilog,如下:
module zhengxing (CLK,Jb_in,zx_out);
input CLK,Jb_in;
output zx_out;
reg zx_out;
reg count;
always@(posedge CLK)
begin
count<=count+1;
if(Jb_in==0)
begin
if(count==9'd496) //24us计时
count<=0;
end
case(count) //判断
9'd0: zx_out<=1;
9'd432: zx_out<=0;
default: zx_out<=zx_out;
endcase
end
endmodule
仿真时提示:case item expression is ignored because it never applies
即无法让zx_out置0,请问程序上有什么问题?高手帮忙看看~
 楼主| 发表于 2006-10-16 14:44:00 | 显示全部楼层
已解决,犯了一个很弱智的错误~
点评回复

使用道具 举报

发表于 2006-10-16 20:49:00 | 显示全部楼层
没定义count 的位宽,默认为1位。
点评回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )

GMT+8, 2024-9-29 14:35 , Processed in 0.047227 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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