版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、 用quartus II 软件设计4位乘法器1. 并行乘法的算法: 下面根据乘法例题来分析这种算法,题中M4,M3,M2,M1是被乘数,用M表示。N4,N3,N2,N1是乘数,用N表示2.乘法模块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;Architectur
2、e behave of and4a isBegin Process(en,a(3 downto 0) Begin If (en=1) then r=a; Else r=0000; End if;End process;End behave;3. 加法模块Library ieee;Use ieee.std_logic_1164.all;Use ieee.std_logic_unsigned.all;Entity ls283 isPort (o1,o2:in std_logic_vector(3 downto 0); res:out std_logic_vector(4 downto 0);End
3、 ls283;Architecture behave of ls283 isBegin Process(o1,o2) Begin res=(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 isPort (op1,op2:in std_logic_vector(3 downto 0); result:out std_logic_vector(7 downto 0);End mul4p;Ar
4、chitecture count of mul4p is component 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 downto 0); res:out std_logic_vector(4 downto 0);End component;Signal sa:std_logic_vector(3 downto
5、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);Signal sg:std_logic_vector(3 downto 0);-signal tmp1:std_logic;Begin sg=(0&sf (3 downto 1); -tmp1op2,en
6、=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=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)=;End count;5.仿真波形图6.引脚分配图7. 硬件下载编程与硬件实
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 酶制剂制备工安全宣教模拟考核试卷含答案
- 气体充装工岗前基础实操考核试卷含答案
- 链板冲压工安全生产能力模拟考核试卷含答案
- 新生儿早期智力开发游戏
- 手电筒制作工安全文明知识考核试卷含答案
- 早产儿呼吸系统感染的综合护理
- 护理科研的方法与步骤
- 莒南县人群血清必需元素含量与常见慢性病的相关性探究
- 药室温度测量装置检定系统的构建与实践:原理、技术与应用
- 荧光免疫吸附法:食品中α-乳白蛋白过敏原检测的精准探索
- 110接处警建设方案
- 2026公共营养师之三级营养师题库附答案
- (正式版)DB61∕T 1989-2025 《 土地整治项目耕地等别评定及产能评估技术规范》
- 地震观测技术介绍
- 2025年广东省职业病诊断医师考试(职业性尘肺病)历年参考题库及答案
- 水厂安全用电培训课件
- 2026年安徽军转考试试题
- 融雪性洪水课件
- 网络意识形态培训课件
- 雨课堂学堂在线学堂云《航海概论(大连海事)》单元测试考核答案
- 《运输机场专业工程竣工验收管理办法验收检查单》
评论
0/150
提交评论