哪位大虾能告诉我这程序问题出哪里啦啊?
语法没错误,但是综合就报错啊!而且我也不知道咋改?
做的是把四位加法器串成16位加法器
module adder
(A,
B,
cin,
OUT,
Co
);
input [15:0] A;
input [15:0] B;
input cin;
output reg [15:0]OUT;
output reg Co;
wire wire_1,wire_2,wire_3;
adder_a u_adder_1
(.A(A[3:0]),
.B(B[3:0]),
.cin(cin),
.OUT(OUT[3:0]),
.Co(wire_1));
adder_a u_adder_2
(.A(A[7:4]),
.B(B[7:4]),
.cin(wire_1),
.OUT(OUT[7:4]),
.Co(wire_2));
adder_a u_adder_3
(.A(A[11:8]),
.B(B[11:8]),
.cin(wire_2),
.OUT(OUT[11:8]),
.Co(wire_3));
adder_a u_adder_4
(.A(A[15:11]),
.B(B[15:11]),
.cin(wire_3),
.OUT(OUT[15:11]),
.Co(Co));
endmodule
module adder_a
(A,B,cin,Co,OUT
);
input [3:0] A;
input [3:0] B;
input cin;
output reg [3:0] OUT;
output reg Co;
always
{Co,OUT}=A+B+cin;
endmodule
此帖出自
小平头技术问答
{Co,OUT}=A+B+cin;
endmodule
我单独做为一个模块了,能综合仿真啊。
一周热门 更多>