版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、用quartus II软件设计4位乘法器1.并行乘法的算法:卜而根据乘法例题来分析这种算法,题中 M4, M3, M2, M1是被乘数,用M表示。N4,N3,N2,N1是乘数,用N表示4/16/20122.乘法模块Library ieee;Use ieee.std_logic_1164.all;Use ieee.std_logic_unsigned.all;Entity and4a isPort(a:in std_logic_vector(3 downto 0);en:in std_logic;r:out std_logic_vector(3 downto 0);End and4a;Archi
2、tecture behave of and4a isBeginProcess(en,a(3 downto 0)BeginIf (en=1) thenr=a;Elser=0000”;End if;End process;End behave;-and4a元件源程序library ieee;use ieee.stdjogicl 164.all;use ieee.std_logic_unsigned.all;璀 I,。)一 两仞一entity and4a is丫 g). Q 昌mul4p=1套歹噌琢粉Proit!i_t NavigatorEnti tv * 瓣 and4a.vhd瓣 is283.vh
3、d| 辱 mul4p.vhd。Compilation Fl ep. | 旦 mul4p. vwfl幽 FLEK10K: EFF10K10LC i mul4pdb,加法模块ModulePrugi-tjEE %JS i mill at orLHLibrary ieee;12345678910111213141516171819202122Liljrary ieee;Use ieee . stcl_ 1 gic_ 1164 .all;Use ieee std_1gic_uns igned.a11;H Ent.it.y and4a isP rt- (a: in std_lugic_vector (3
4、dunnt-u u:i ;en: in 3t.Ll_lugic;r : ut stcl_logic_vectur (3 duTiinto u :i :i ;End and4a;IS Architect, ur e toe have f ancH a isH BeginPeucess (en,r a (3 duTiintu 0) :i BeginIf (en= 1 11 ) t-hen rOa;HElser=ULIULI;End if;Encl process;End toehave;Use ieee.std_logic_1164.all;Use ieee.std_logic_unsigned.
5、all;Entity ls283 isPort (o1,o2:in std_logic_vector(3 downto 0); res:out std_logic_vector(4 downto 0); End ls283;Architecture behave of ls283 isBeginProcess(o1,o2)Beginres=(0&o1)+(0&o2);End process;End behave;4.主程序Library ieee;Use ieee.std_logic_1164.all;Use ieee.std_logic_unsigned.all;Entity mul4p i
6、sPort (op1,op2:in std_logic_vector(3 downto 0);result:out std_logic_vector(7 downto 0);End mul4p;Architecture count of mul4p iscomponent and4a port (a:in std_logic_vector(3 downto 0); en:in std_logic;r:out std_logic_vector(3 downto 0);End component;Component ls283 port (o1,o2:in std_logic_vector(3 d
7、ownto 0); res:out std_logic_vector(4 downto 0);End component;Signal sa:std_logic_vector(3 downto 0);Signal sb:std_logic_vector(4 downto 0);Signal sc:std_logic_vector(3 downto 0);Signal sd:std_logic_vector(4 downto 0);Signal se:std_logic_vector(3 downto 0);Signal sf:std_logic_vector(3 downto 0);Signa
8、l sg:std_logic_vector(3 downto 0);-signal tmp1:std_logic;Beginsg=(0&sf (3 downto 1);-tmp1op2,en=op1(1),r=se);U1:and4a port map(a=op2,en=op1(3),r=sa);U2:ls283 port map(o1=sb(4 downto 1),o2=sa,res=result(7 downto 3);U3:and4a port map(a=op2,en=op1(2),r=sc);U4:ls283 port map(o1=sc,o2=sd(4 downto 1),res=
9、sb);u5:ls283 port map(o1=sg,o2=se,res=sd);u6:and4a port map(a=op2,en=op1(0),r=sf);result(0)=sf(0);result(1)=sd(0);result(2)=sb(0);-result(7 downto 0) Compilation. | 包 mul4p.vwf | 料 Simulation R. | Pin Planner I 断(roup 5Named:Nude Nameop2r3IniX :-op221Iniop2lOP20毒日 re5ultr7.O=_一II1TOI.CF :- resultr?O
10、lCF resultrfiOl祁 result5TCpVfeWFLBCWKEPFl0K10LC8i-*J.amed:B=| 明 Edit: _xy |PIN_50Filter: |pin:s: eNode NameDirectionLocationReservedGroup1W opl3InputPIN_28opl3.02W opl2InputPIN_29opl3.03 opllInputPIN_30opl3,.0qW opl0InputPIN_35opl3.05W op23InputPIN_47op23.06op22InputPIN_48op23.07W op2lInputPIN_49op23.08op20InputPIN_50op23.09涉 re5ult7OutputPIN_61result7.O10枝 result6OutputPIN_60result7.O11涉 result5OutputPIN_59result7.O12祁 result4OutputPIN_58result7.O13涉 re5ult3OutputPIN_54result7.O14枝 result2OutputPIN_53result7.O15涉 resultlOutputPIN
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025关于二手商品房的买卖合同范本
- 《壹午壹食》餐厅导示系统方案设计
- 2025青岛市房屋租赁合同范本简介
- 2025调整劳动合同模板
- 2025仓库租房合同模板
- 2025国考外交部行测必刷题及答案
- 2025二手(办公楼)买卖合同书
- 2025(养殖)农产品采购合同
- 二手车 贷款 协议书
- 安卓模拟器协议书
- 肉鸡放养回收合同(2篇)
- 【7上英WY】合肥市庐阳中学2023-2024学年七年级上学期期中英语试卷
- 主要粮食作物机收减损技术-农业农机技术培训课件
- Nikon尼康D3100中文说明书
- DL∕T 1802-2018 水电厂自动发电控制及自动电压控制技术规范
- 2024年个人信用报告(个人简版)样本(带水印-可编辑)
- 智能设计完整版本
- 在线网课知慧《美国史(东北师大)》单元测试考核答案
- 护理职业规划大赛
- 安全生产投入台账(模板)
- 医保智能审核系统解决方案
评论
0/150
提交评论