on-internet
← Community

How do I solve these parse errors?

Stack Overflow ·

I'm trying to code in Verilog a Parallel Carry Adder, but the code won't compile because of several errors that I frankly don't understand. Here is the code: 1 module full_adder (a,b,c_in,s,c); 2 input a,b,c_in; 3 output s,c; 4 assign s = a ^ (b ^ c_in); 5 assign c = (a & b) | (c_in & (a | b)); 6 endmodule 8 module rc_adder (a,b,cin,s,cout); 9 input a,b,cin; 10 output s,cout; 11 parameter N = 32; // bits 12 wire[N-1:0] a; 13 wire[N-1:0] b; 14 wire[N-1:0] s; 15 wire cin; 16 wire cout; 17 wire[N-1:0] _c; 18 assign cout = _c[N-1]; 20 full_adder add0(.a(a[0]),.b(b[0]),.c_in(cin),.s(s[0]),.c(_c[0])

Comments

Sign in or sign up to comment and upvote.

No comments yet.