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?

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.