资源分配

时间:2014-04-03 01:19:59   收藏:0   阅读:557
  所谓资源分配,是指在互斥条件下,共享ALU的过程。
  通常利用多路选择器的引入,来减少ALU的个数,从而节省资源。
  看下列实例:
if (!ishreg)
     data_out = addr_load + chip_sel;
else if (rd_wr)
     data_out = read + write;
else
     data_out = addr_load + read;
 
  改进后:
 
if (!shReg)
begin
     temp1 = addr_load;
     temp2 = chip_sel;
end
else if (rd_wr)
begin
     temp1 = read;
     temp2 = write;
end
else
begin
     temp1 = addr_load;
     temp2 = read;
end
 
data_out = temp1 + temp2;
 
  改进后的代码多产生了一个多路选择器,但是只使用了一个加法器,而改进之前的代码使用了三个加法器。

资源分配,布布扣,bubuko.com

原文:http://www.cnblogs.com/chenman/p/3641770.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!