您的位置:首页 > 其它

Error (10028): Can't resol…

2014-03-24 12:33 417 查看
原文地址:(10028): Can't resolve multiple constant drivers for net "out2" at shiyan.v(14)解决办法">Error (10028): Can't resolve multiple constant drivers for net "out2" at shiyan.v(14)解决办法作者:老实的娃娃module shiyan(c1,c2,out1,out2);
input c1,c2;
output out1,out2;

reg out1,out2;

always @(posedge c1)
begin

out1<=0;
out2<=0;
end

always@(posedge c2)
begin

out1<=0;
out2<=1;

end

endmodule

上面的代码在quartusII里面就会出现题目的错误提示,器原因就是在两个always语句里面都对out1,out2信号赋值了,而两个always是并行快,所以提示出现多重驱动的情况。。。

解决办法:

将两个always合并为一个

module shiyan(c1,c2,out1,out2);
input c1,c2;
output out1,out2;

reg out1,out2;

always @(posedge c1 or posedge c2)
if(c1==1)

begin
out1<=0;
out2<=0;
end

else
begin
out1<=0;
out2<=1;
end
endmodule


ok!

打完收工!!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: