I am trying to synthesize a weighted sum circuit which will essentially implement the following equation,
out=out+a[i]*w[i] , where i=0,1..n
I have written the following code but synthesizing in design vision environment generates error as following
ELAB-368 (error) %s Net '%s', or a directly connected net, is driven by more than one source, and at least one source is a constant net.
module weighted_sum #(parameter n=10)(input [7:0] a[3:0], input [7:0] w[3:0], output [7:0] out);
assign out=0;
genvar i;
generate
for (i=0;i<n;i=i+1) begin:block1
out=out+a[i]*b[i];
end
endgenerate
endmodule
Any direction is appreciated.
Thanks Farhana