基于IP核的乘法器的设计_

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

XilinxFPGA实验报告——基于IP核的乘法器的设计基于IP核的乘法器的设计1.实验内容1)利用ISE软件的IP核和VHDL进行混合设计一个16位的乘法器;2)用ISE进行仿真并且进行性能比较;2.实验目的1)熟悉Xilinx的ISE软件的使用和设计流程;2)掌握ISE仿真方法;3.实验环境1)PC机一台;2)Xilinx的ISE软件一套;4.实验原理图1给出了16位乘法器的原理图XilinxISE的coregenerator提供了功能强大的IP(intellectualProperty)核,主要有BasicElements,Clocking,Communication&Networking,DigitalSignalProcessing,I/OInterface,MathFunctions,Memories&StorageElements,StandardBusInterface。通过使用这些IP核资源可以大大缩短设计周期,提高设计效率。在本设计中,使用了IP核MathFunction中的Multiplier资源。通过GUI接口,可以很容易设计任意位的,有符号或无符号的乘法器。图2给出了IP核提供的乘法器的原理图。5.实验步骤1)打开ISE软件创建一个新的工程,并选择器件的类型;2)用IP核生成一个16位的乘法器multiplier1;3)用VHDL语言生成一个16位的乘法器multiplier2;4)用例化语句component,portmap合成一个顶层文件top.vhd;CLK图1两个16位乘法器的原理图ABAQ1AQ21A乘法器1乘法器2图2IP核乘法器的原理图5)调用ISE仿真器进行行为仿真,观察仿真结果;6)调用ISE仿真器进行时序仿真,观察仿真结果;6.实验结果1)代码顶层文件Multiply_top.vhdlibraryIEEE;useIEEE.STD_LOGIC_1164.ALL;entityMultiply_topisPort(number1:inSTD_LOGIC_VECTOR(15downto0);number2:inSTD_LOGIC_VECTOR(15downto0);result1:outSTD_LOGIC_VECTOR(31downto0);result2:outSTD_LOGIC_VECTOR(31downto0);clock:inSTD_LOGIC);endMultiply_top;architectureBehavioralofMultiply_topiscomponentMultiplyport(A:inSTD_LOGIC_VECTOR(15downto0);B:inSTD_LOGIC_VECTOR(15downto0);CLK:inSTD_LOGIC;P:outSTD_LOGIC_VECTOR(31downto0));endcomponent;componentMultiply2port(A:inSTD_LOGIC_VECTOR(15downto0);B:inSTD_LOGIC_VECTOR(15downto0);CLK:inSTD_LOGIC;P:outSTD_LOGIC_VECTOR(31downto0));endcomponent;beginU0:Multiplyportmap(A=number1,B=number2,CLK=clock,P=result1);U1:Multiply2portmap(A=number1,B=number2,CLK=clock,P=result2);endBehavioral;乘法器Multiply2.vhdlibraryIEEE;useIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;USEIEEE.STD_LOGIC_ARITH.ALL;entityMultiply2isport(A:inSTD_LOGIC_VECTOR(15downto0);B:inSTD_LOGIC_VECTOR(15downto0);CLK:inSTD_LOGIC;P:outSTD_LOGIC_VECTOR(31downto0));endMultiply2;architectureBehavioralofMultiply2isbeginP=A*B;endBehavioral;测试文件:LIBRARYieee;USEieee.std_logic_1164.ALL;ENTITYtest_topISENDtest_top;ARCHITECTUREbehaviorOFtest_topIS--ComponentDeclarationfortheUnitUnderTest(UUT)COMPONENTMultiply_topPORT(number1:INstd_logic_vector(15downto0);number2:INstd_logic_vector(15downto0);result1:OUTstd_logic_vector(31downto0);result2:OUTstd_logic_vector(31downto0);clock:INstd_logic);ENDCOMPONENT;--Inputssignalnumber1:std_logic_vector(15downto0):=(others='0');signalnumber2:std_logic_vector(15downto0):=(others='0');signalclock:std_logic:='0';--Outputssignalresult1:std_logic_vector(31downto0);signalresult2:std_logic_vector(31downto0);--Clockperioddefinitionsconstantclock_period:time:=10ns;BEGIN--InstantiatetheUnitUnderTest(UUT)uut:Multiply_topPORTMAP(number1=number1,number2=number2,result1=result1,result2=result2,clock=clock);--Clockprocessdefinitionsclock_process:processbeginclock='0';waitforclock_period/2;clock='1';waitforclock_period/2;endprocess;--Stimulusprocessstim_proc:processbegin--holdresetstatefor100ns.waitfor100ns;waitforclock_period*10;--insertstimulusherenumber1=0000000011111111;number2=0000000011111111;wait;endprocess;END;2)行为仿真7.实验总结两种方式得到的结果都是一样的。用IP核生成一个16位的乘法器multiplier1相比于用VHDL语言生成一个16位的乘法器multiplier2速度要慢,可能是因为IP核中集成了一些冗余的部分。

1 / 7
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功