这是我写的512位加法器verilog程序,在quartus中运行错误是IO资源不够,这个要占用1500多个,但只能提供300多个,请教高手该怎么办啊,先谢谢了
module adder(ina,inb,cin,outsum,cout); output [512:1] outsum; output cout; input [512:1] ina,inb; input cin; wire c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15;
full_add32 fo(.ina(ina[32:1]),.inb(inb[32:1]),.cin(cin),.outsum(outsum[32:1]),.cout(c1)); full_add32 f1(.ina(ina[64:33]),.inb(inb[64:33]),.cin(c1),.outsum(outsum[64:33]),.cout(c2)); full_add32 f2(.ina(ina[96:65]),.inb(inb[96:65]),.cin(c2),.outsum(outsum[96:65]),.cout(c3)); full_add32 f3(.ina(ina[128:97]),.inb(inb[128:97]),.cin(c3),.outsum(outsum[128:97]),.cout(c4)); full_add32 f4(.ina(ina[160:129]),.inb(inb[160:129]),.cin(c4),.outsum(outsum[160:129]),.cout(c5)); full_add32 f5(.ina(ina[192:161]),.inb(inb[192:161]),.cin(c5),.outsum(outsum[192:161]),.cout(c6)); full_add32 f6(.ina(ina[224:193]),.inb(inb[224:193]),.cin(c6),.outsum(outsum[224:193]),.cout(c7)); full_add32 f7(.ina(ina[256:225]),.inb(inb[256:225]),.cin(c7),.outsum(outsum[256:225]),.cout(c8)); full_add32 f8(.ina(ina[288:257]),.inb(inb[288:257]),.cin(c8),.outsum(outsum[288:257]),.cout(c9)); full_add32 f9(.ina(ina[320:289]),.inb(inb[320:289]),.cin(c9),.outsum(outsum[320:289]),.cout(c10)); full_add32 f10(.ina(ina[352:321]),.inb(inb[352:321]),.cin(c10),.outsum(outsum[352:321]),.cout(c11)); full_add32 f11(.ina(ina[384:353]),.inb(inb[384:353]),.cin(c11),.outsum(outsum[384:353]),.cout(c12)); full_add32 f12(.ina(ina[416:385]),.inb(inb[416:385]),.cin(c12),.outsum(outsum[416:385]),.cout(c13)); full_add32 f13(.ina(ina[448:417]),.inb(inb[448:417]),.cin(c13),.outsum(outsum[448:417]),.cout(c14)); full_add32 f14(.ina(ina[480:449]),.inb(inb[480:449]),.cin(c14),.outsum(outsum[480:449]),.cout(c15)); full_add32 f15(.ina(ina[512:481]),.inb(inb[512:481]),.cin(c15),.outsum(outsum[512:481]),.cout(cout)); endmodule
module full_add32(ina,inb,cin,outsum,cout); output[32:1] outsum; output cout; input[32:1] ina,inb; input cin; assign {cout,outsum}=ina+inb+cin; endmodule |