8位并行乘法器

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

8位并行乘法器

在数字信号处理中,乘法器的速度对整个芯片以及系统性能有着重要影响。随着超大规模集成电路的发展,高速、低功耗、版图设计规则、占用芯片面积小等是乘法器研究的重点。

串行乘法器,通常是两个N位二进制数x、y的乘积用简单的方法计算就是利用移位操作来实现。但计算一次乘法需要8个周期,这种乘法器的优点是所占用的资源是所有类型乘法器中最少的,在低速的信号处理中有着广泛的应用,但是串行乘法器速度比较慢、时延大。

为了加快运算速度,一般的快速乘法器通常采用逐位并行的迭代阵列结构,将每个操作数的N位都并行地提交给乘法器。但是一般对于FPGA来讲,进位的速度快于加法的速度,这种阵列结构并不是最优的。所以可以采用多级流水线的形式,将相邻的两个部分乘积结果再加到最终的输出乘积上,即排成一个二叉树形式的结构,这样对于N位乘法器需要lb(N)级来实现。

一、VHDL代码

library IEEE;

use IEEE.STD_LOGIC_1164.all;

use IEEE.STD_LOGIC_ARITH.all;

use IEEE.STD_LOGIC_UNSIGNED.all;

entity chengfa is

port( clk :in std_logic;

a :in std_logic_VECTOR(7 downto 0);

b :in std_logic_VECTOR(7 downto 0);

cout:out std_logic_VECTOR(15 downto 0) );

end chengfa;

architecture one of chengfa is

signal a1,b1:std_logic_vector(3 downto 0);

signal a2,b2:std_logic_vector(7 downto 4);

signal cout1:std_logic_vector(15 downto 0);

signal cout2:std_logic_vector(15 downto 0);

signal a1b1,a2b1,a1b2,a2b2:std_logic_vector(15 downto 0); begin

process(a,b,clk)

begin

if clk'event and clk='1' then

a1b1<="0000"&(a(5 downto 0) *b(5 downto 0));

a2b1<="00"&(a(7 downto 6)*b(5 downto 0))&"000000"; a1b2<="00"&(a(5 downto 0)*b(7 downto 6))&"000000"; a2b2<=(a(7 downto 6)*b(7 downto 6))&"000000000000"; end if;

end process;

process(clk)

begin

if clk'event and clk='1' then

cout1<=a1b1+a2b1;

cout2<=a1b2+a2b2;

end if;

end process;

process(clk)

begin

if clk'event and clk='1' then

cout<=cout1+cout2;

end if;

end process;

end one;

相关文档
最新文档