2
module rc_adder4 (
    input logic[2:0]a, b
    output logic[2:0] s, 
    output logic c_out
    );
    logic [3:0] c;

    rc_adder_slice UUT[2:0] (
    .a(a),
    .b(b),
    .c_in(c[2:0]),
    .s(s),
    .c_out(c[3:1])

);

// COMPLETE USING ARRAY INSTANCING

    assign c[0] = 1'b0;// COMPLETE
    assign c_out = c[3];// COMPLETE
    
endmodule

I tried to run this part, but it said:

near "output": syntax error, unexpected output, expecting ')'

Can anyone help me please?

toolic
  • 57,801
  • 17
  • 75
  • 117

1 Answers1

2

The simulator I use gives a more meaningful error message:

    output logic[2:0] s, 
         |
xmvlog: *E,POLICI: Expecting a comma between adjacent port declarations.

This is telling you that you need to separate all signals with commas, and you are missing the comma between the last input and first output.

Change:

input logic[2:0]a, b

to:

input logic[2:0]a, b,
//                  ^

Sometimes different simulators can give you more helpful messages. You can sign up for a free account on edaplaygroud to get access to several simulators.

toolic
  • 57,801
  • 17
  • 75
  • 117