In your adder6
declaration have this line:
adder4 a(.sum([3:0]),c_o[0],.a(a[3:0]), .b(b[3:0),c_in); //4-bits adder
As you can see, you’ve called an instance of adder4
a
. At the same time, you’ve called an input port a
. That’s why you’re getting an error when trying to compile your code. The easiest solution would be to rename an adder4
instance.
Btw that particular line should look a little bit different in case to work:
adder4 add(.sum(sum[3:0]), .c_out(c_o[0]), .a(a[3:0]), .b(b[3:0]), .c_in(c_in));
solved 6-bit Full Adder returns with an error [closed]