Hi, I'm having trouble getting two files to work in quartus.
Here is full_adder.v
1
modulefull_adder(S,Cout,A,B,Cin);
2
outputS;
3
outputCout;
4
inputA;
5
inputB;
6
inputCin;
7
wirenor1_out,and1_out,and2_out;
8
nornor1(nor1_out,A,B);
9
nornor2(S,nor1_out,Cin);
10
andand1(and1_out,Cin,nor1_out);
11
andand2(and2_out,A,B);
12
oror1(Cout,and1_out,and2_out);
13
endmodule
And here is ripple_carry_adder.v
1
moduleripple_carry_adder
2
(
3
outputCout,
4
output[7:0]Sum,
5
outputoverflow_flag,
6
input[7:0]A,
7
input[7:0]B,
8
inputCin
9
);
10
regmytemp,mytemp2;
11
12
full_adderA1(Sum[0],mytemp,A[0],B[0],Cin);
13
full_adderA2(Sum[1],mytemp2,A[1],B[1],mytemp);
14
full_adderA3(Sum[2],mytemp,A[2],B[2],mytemp2);
15
full_adderA4(Sum[3],mytemp2,A[3],B[3],mytemp);
16
full_adderA5(Sum[4],mytemp,A[4],B[4],mytemp2);
17
full_adderA6(Sum[5],mytemp2,A[5],B[5],mytemp);
18
full_adderA7(Sum[6],mytemp,A[6],B[6],mytemp2);
19
full_adderA8(Sum[7],Cout,A[7],B[7],mytemp);
20
21
//if(Cout==1)overflow_flag=1;
22
//elseoverflow_flag=0;
23
endmodule
I'm getting and error that says "Verilog HDL Port Connection error at
ripple_carry_adder.v(12): output or inout port "Cout" must be connected
to a structural or net expression", and I've looked over my code but
can't figure it out. I have included both verilog files in my project.
Thank you that worked! For anyone else that has this problem in the
future, it also wouldn't let me stagger mytemp and mytemp2 like that, I
had to make an array [7:0]mytemp