




已阅读5页,还剩3页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
EDA技术与应用实验报告 实验名称:并行乘法器姓 名:陈丹学 号:100401202班 级:电信(2)班时 间:2012.12.18南京理工大学紫金学院电光系一、实验目的1)学习包集和元件例化语句的使用。2)学习FAU(全加器单元)电路的设计。3)学习并行乘法器电路的设计二、实验原理1)用VHDL代码描述FAU、与门电路,要求其操作数有a,b两个,每个操作数都是4位宽度。2)利用元件例化语句构成所需要的基本元件,利用包集声明该元件,在主代码中调用该元件完成设计。三、实验内容6,1并行乘法器的VHDL描述 首先给出两个元件:2端口与门,全加器,然后由这两种元件构成并行乘法器6.21 全加器的设计 全加器的表达式为新建VHDL文件 出入代码将文件保存为adder.vhdlibrary ieee;use ieee.std_logic_1164.all;entity adder isport(a,b,cin:in std_logic;s,c:out std_logic);end adder;architecture rhg of adder isbegins=a xor b xor cin;c=(a and b) or (a and cin) or (b and cin);end rhg;6.2.2 与门新建VHDL文件 出入代码将文件保存为and_2.vhdlibrary ieee;use ieee.std_logic_1164.all;entity and_2 isport(a,b:in std_logic;y:out std_logic);end;architecture rhg of and_2 isbeginy=a and b;end rhg;编译 保存 6.2.3 package 定义新建VHDL文件 输入package定义的VHDL代码 存为my_components.vhdlibrary ieee;use ieee.std_logic_1164.all;package my_components iscomponent and_2 isport(a,b:in std_logic;y:out std_logic);end component;component adder isport(a,b,cin:in std_logic;s,c:out std_logic);end component;end my_components;6.2.4 设计top 单元library ieee;use ieee.std_logic_1164.all;use work.my_components.all;entity top isport(a:in std_logic;b:in std_logic_vector(3 downto 0);s,c:out std_logic_vector(2 downto 0);p:out std_logic);end;architecture rhg of top isbeginb1: and_2 port map(a,b(3),s(2);b2: and_2 port map(a,b(2),s(1);b3: and_2 port map(a,b(1),s(0);b4: and_2 port map(a,b(0),p);c=000;end rhg;6.2.4 设计mid 单元library ieee;use ieee.std_logic_1164.all;use work.my_components.all;entity mid isport(a:in std_logic; b:in std_logic_vector(3 downto 0); sin,cin:in std_logic_vector(2 downto 0); sout,cout:out std_logic_vector(2 downto 0); p:out std_logic);end;architecture rhg of mid issignal and_out:std_logic_vector(2 downto 0);beginb1: and_2 port map(a,b(3),sout(2);b2: and_2 port map(a,b(2),and_out(2);b3: and_2 port map(a,b(1),and_out(1);b4: and_2 port map(a,b(0),and_out(0);b5: adder port map(sin(2),cin(2),and_out(2),sout(1),cout(2);b6: adder port map(sin(1),cin(1),and_out(1),sout(0),cout(1);b7: adder port map(sin(0),cin(0),and_out(0),p,cout(0);end rhg;6.2.5 lower 单元设计library ieee;use ieee.std_logic_1164.all;use work.my_components.all;entity lower isport(sin,cin:in std_logic_vector(2 downto 0); p:out std_logic_vector(3 downto 0);end;architecture rhg of lower issignal local:std_logic_vector(2 downto 0);beginlocal(0)=0;b1:adder port map(sin(0),cin(0),local(0),p(0),local(1);b2:adder port map(sin(1),cin(1),local(1),p(1),local(2);b3:adder port map(sin(2),cin(2),local(2),p(2),p(3);end rhg;6.2.6 package 定义library ieee;use ieee.std_logic_1164.all;package my_com1 iscomponent lower isport(sin,cin:in std_logic_vector(2 downto 0); p:out std_logic_vector(3 downto 0);end component;component mid isport(a:in std_logic; b:in std_logic_vector(3 downto 0); sin,cin:in std_logic_vector(2 downto 0); sout,cout:out std_logic_vector(2 downto 0); p:out std_logic);end component;component top isport(a:in std_logic; b:in std_logic_vector(3 downto 0); s,c:out std_logic_vector(2 downto 0); p:out std_logic);end component;end my_com1;6.2.7 设计并行乘法器library ieee;use ieee.std_logic_1164.all;use work.my_components.all;use work.my_com1.all;entity multiplier is port(a,b:in std_logic_vector(3 downto 0); p:out std_logic_vector(7 downto 0);end;architecture rhg of multiplier is type matrix is array (0 to 3) of std_logic_vector(2 downto 0);signal s,c:matrix;beginb1:top port map(a(0),b,s(0),c(0),p(0);b2:mid port map(a(1),b,s(0),c(0),s(1),c(1),p(1);b3:mid port map(a(2),b,s(1),c(1),s(2),c(2),p(2);b4:mid port map(a(3),b,s(2),c(2),s(3),c(3),p(3);b5:lower por
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 材料力学与智能材料性能预测重点基础知识点
- 材料疲劳裂纹扩展结果验证原理重点基础知识点
- 旅馆火灾应急预案演练(3篇)
- 石灰窑火灾应急预案演练(3篇)
- 消防火灾隐患应急预案(3篇)
- 公司战略分析与风险评估中的综合应用试题及答案
- 小区火灾应急预案总结(3篇)
- 2025年公司战略与风险管理中必须关注的法律问题试题及答案
- 医院护理火灾演练应急预案(3篇)
- 2025年VB考试备考计划试题及答案手册
- 安徽省1号卷A10联盟2025届高三5月最后一卷数学试题及答案
- 2024-2025部编版小学道德与法治二年级下册期末考试卷及答案 (三套)
- 八年级数学题试卷及答案
- 2025-2030中国试管行业市场发展趋势与前景展望战略研究报告
- 2025年贵州省中考英语一模试题无答案
- 2025年物业管理从业人员考试试卷及答案
- 比亚迪新能源汽车业务竞争战略:基于全产业链优势的多维剖析与展望
- 教研员考试试题及答案
- 河北检察院试题及答案
- 四川省成都市青羊区2025年中考语文二诊试卷(含答案)
- 2024年同等学力英语高频词汇
评论
0/150
提交评论