verilog写的程序用ISE跑报错 Xst:1706是什么问题?

程序是这样的:
module moshiqiehuan(clk,btn,out
);
input clk;
input[2:0] btn;
output out;

reg[2:0] out,n;
reg[7:0] count=0;

always@(posedge clk)
begin
if(count==1000)
begin
count=0;
n[0]=btn[0];
n[1]=btn[1];
n[2]=btn[2];
end
else
count=count+1;
end

always@(posedge clk)
begin
case (n)
3'b001:out=3'b111;
3'b010:out=3'b001;
3'b100:out=3'b010;
default: out=3'b111;
endcase
end
endmodule
报错如下:
ERROR:Xst:1706 - Unit <moshiqiehuan>: port <out_index0002> of logic node <out_mux0000<1>> has no source
ERROR:Xst:1706 - Unit <moshiqiehuan>: port <out_index0001> of logic node <out_mux0000<2>> has no source
ERROR:Xst:1706 - Unit <moshiqiehuan>: port <out_index0001> of logic node <out_or0000> has no source
ERROR:Xst:1847 - Design checking failed
程序很简单,想不通啊,求解

从代码来看,你要注意:

output out;            //此处是一位的输出信号,和后续的定义及使用有矛盾,改改试试吧

追问

改了还是报相同的错误,不是这个地方噢

追答

看了,你的count是8位的,永远达不到count==1000这个条件。^_^

温馨提示:答案为网友推荐,仅供参考

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网