版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 幼儿园家长陪餐工作制度
- 幼儿园应急管理工作制度
- 幼儿园接替工作制度汇编
- 幼儿园校医日常工作制度
- 幼儿园灭鼠防病工作制度
- 幼儿园督学挂牌工作制度
- 幼儿园老师教研工作制度
- 幼儿园防震防灾工作制度
- 应急行动6小时工作制度
- 夹子底模设计和实现 机械制造自动化专业
- 四川三江招商集团有限公司2026年3月公开招聘工作人员考试参考试题及答案解析
- 【励志教育】主题班会:《张雪机车夺冠》从山村少年到世界冠军的缔造者【课件】
- 2026重庆酉阳自治县城区学校选聘教职工91人笔试模拟试题及答案解析
- 2026湖北松滋金松投资控股集团有限公司招聘28人笔试备考试题及答案解析
- 2026江苏无锡惠高新运产业招商发展有限公司招聘6人笔试备考题库及答案解析
- T∕CEA 3030-2026 乘运质量等级 第2部分:自动扶梯和 自动人行道
- 2025年云南省中考数学-26题二次函数降次幂题35道
- 幼儿园安全教育管理PPT(37P)
- XX集团公司“揭榜挂帅”实施办法
- 第二单元+认识社会与价值选择复习课件 【知识精讲+备课精研】 高中政治统编版必修四哲学与文化
- 晶闸管及其工作原理-课件
评论
0/150
提交评论