程序是这样的:
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这个条件。^_^