I am trying to write a 100-ripple carry adder. Fist I design a full adder. Then I need to connect 100 full adders. I am getting errors:
Error (10170): Verilog HDL syntax error at top_module.v(11) near text: "instance1"; expecting "<=", or "=", or "+=", or "-=", or "*=", or "/=", or "%=", or "&=", or "|=", or "^=", or "<<=", or ">>=", or "<<<=", or ">>>=", or "++", or "--". Check for and fix any syntax errors that appear immediately before or at the specified keyword. The Intel FPGA Knowledge Database contains many articles with specific details on how to resolve this error. Visit the Knowledge Database at https://www.altera.com/support/support-resources/knowledge-base/search.html and search for this specific error message number. File: /var/www/verilog/work/vlg7ccmQf_dir/top_module.v Line: 11
module top_module(
input [99:0] a, b,
input cin,
output [99:0] cout,
output [99:0] sum );
assign {cout[0],sum[0]}=a[0]+b[0]+cin;
always@ (*)
begin
for (int i=1; i<$bits(a);i++)
full_adder instance1(
.a_1(a[i]),
.b_1(b[i]),
.cin_1(cout[i-1]),
.cout_1(cout[i]),
.sum_1(sum[i])
);
end
endmodule
module full_adder(
input a_1, b_1,
input cin_1,
output cout_1,
output sum_1
);
assign {cout_1,sum_1}=cin_1+a_1+b_1;
endmodule