打印

求助高手--512位加法器

[复制链接]
1669|4
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
drsd|  楼主 | 2009-5-11 23:20 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
这是我写的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

相关帖子

沙发
patrick007| | 2009-5-12 00:25 | 只看该作者

re

512*(2in+1out)  .......

try 64bits in and out, and use comb logic to 


7+7 = (3+3+1)+(3+3+1)

使用特权

评论回复
板凳
Fourier00| | 2009-5-15 20:11 | 只看该作者

lz是为了让这个玩意编译过去

lz是为了让这个玩意编译过去? 
可以试试大一点的片子,或者用虚拟pin

使用特权

评论回复
地板
beinghu| | 2009-7-3 15:56 | 只看该作者

用个top模块包起来

top模块的io少于300就没事了

使用特权

评论回复
5
氧化| | 2009-7-3 21:15 | 只看该作者

Fourier00 正解!

Fourier00 正解!

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1

主题

1

帖子

0

粉丝