Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16597 Discussions

Multiple Constant Driver Error

Altera_Forum
Honored Contributor II
872 Views

Hi all, 

I am trying to implement a full adder with generate-endgenerate approach. 

But I got a error message("Error (10028): Can't resolve multiple constant drivers for net "cout" at fulladder.v(33)"), and there seems to be something wrong with my code in line "cout=(a&b)|(a&c[i-1])|(b&c[i-1]);" 

 

Anyone can help me out of this...? Thanks in advance:) 

 

module fulladder# (parameter width=4) (output reg sum, output reg cout,neg,overflow, input a,b, input cin); reg c; generate genvar i; for(i=0;i<=width-1;i=i+1)begin:stage case(i) 0:begin always@(*)begin sum=a^b^cin; c=(a&b)|(a&cin)|(b&cin); end end width-1:begin always@(*)begin sum=a^b^c; cout=(a&b)|(a&c)|(b&c); neg=sum; overflow=cout^c; end end default:begin always@(*)begin sum=a^b^c; cout=(a&b)|(a&c)|(b&c); end end endcase end endgenerate endmodule
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
186 Views

The implementation is incorrect. You would want to assign c[i] instead of cout in case default

0 Kudos
Altera_Forum
Honored Contributor II
186 Views

Thanks a lot...FvM 

Kinda felt embarrassed about this mistake...
0 Kudos
Reply