




已阅读5页,还剩4页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
深 圳 大 学 实 验 报 告 课程名称: VHDL数字电路设计教程 实验项目名称: 5位逐级进位和超前进位加法器设计 学院: 信息工程学院 专业: 电子信息工程 指导教师: 梁松海 报告人:黄德荣 学号:20006031459 班级: 1班 实验时间: 2008.10.22 实验报告提交时间: 2008.11.5 教务处制实验目的与要求:用XILINX ISE 7.1i实现逐级进位和超前进位加法器方法、步骤:1,逐级进位加法器对每一位都使用了全加器FAU,图中a和b是输入位,cin是进位输入位。S是求和的结果,cout是进位输出位。C是进位矢量。图中每个全加器的输出结果都依赖于前一级产生的进位。由全加器的特性,可以写出如下的逻辑表达式:S=a XOR b XOR cincout=(a AND)(AND cin)OR(b AND cin)2,超前进位加法器电路实现是需要两个非常重要的中间信号:generate和propagate,分别由g和p表示。加法器两个输入位是a和b,则generate和propagate信号定义如下:g=a AND bp=a XOR b这两个信号与进位无关,只根据当前的输入计算。现在两个输入矢量是:a=a(4)a(3)a(2)a(1)a(0)和b=b(4)b(3)b(2)b(1)b(0),那么相应的generate矢量为g=g(4)g(3)g(2)g(1)g(0),相应的propagate矢量为p=p(4)p(3)p(2)p(1)p(0)。其中: g(j)=a (j) AND b(j)p(j)=a (j)XOR b(j) 同时,进位矢量用c=c(4)c(3)c(2)c(1)c(0)。进位可由g和p按照下面的方法计算得到: c(0) = cin; c(1) = c(0)p(0)+g(0); c(2) = c(0)p(0)p(1)+g(0)p(1)+g(1); c(3) = c(0)p(0)p(1) p(2)+g(0)p(1)p(2)+(g(1) p(2)+g(2); c(4) = c(0)p(0) p(1) p(2) p(3)+g(0) p(1) p(2) p(3)+g(1) p(2) p(3)+g(2) p(3)+g(3);c(5) =c(0)p(0) p(1) p(2) p(3) p(4)+g(0) p(1) p(2)p(3) p(4)+g(1) p(2) p(3) p(4)+g(2) p(3) p(4)+g(4); 可见超前进位加法器的每个全加器不依赖与前一级进位输出的计算结果,有利于提高电路执行速度。实验过程及内容:1, 逐级进位加法器VHDL代码- Company: - Engineer:- Create Date: 02:59:18 10/22/08- Design Name: - Module Name: adder - Behavioral- Project Name: - Target Device: - Tool versions: - Description:- Dependencies:- - Revision:- Revision 0.01 - File Created- Additional Comments:- -library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;- Uncomment the following library declaration if instantiating- any Xilinx primitives in this code.-library UNISIM;-use UNISIM.VComponents.all;entity adder isport(a,b:in std_logic_vector(4 downto 0);cin:in std_logic;s: out std_logic_vector(4 downto 0);cout:out std_logic);end adder;architecture Behavioral of adder is signal c:std_logic_vector(4 downto 0);beginc(0)=cin;s(0)=a(0) xor b(0) xor c(0);c(1)=(a(0)and b(0)or (a(0)and c(0)or (b(0)and c(0);s(1)=a(1) xor b(1) xor c(1);c(2)=(a(1)and b(1)or (a(1)and c(1)or (b(1)and c(1);s(2)=a(2) xor b(2) xor c(2);c(3)=(a(2)and b(2)or (a(2)and c(2)or (b(2)and c(2);s(3)=a(3) xor b(3) xor c(3);c(4)=(a(3)and b(3)or (a(3)and c(3)or (b(3)and c(3);s(4)=a(4) xor b(4) xor c(4);cout=(a(4)and b(4)or (a(4)and c(4)or (b(4)and c(4); end Behavioral;仿真波形2, 超前进位加法器VHDL代码- Company: - Engineer:- Create Date: 14:51:14 11/05/08- Design Name: - Module Name: sd - Behavioral- Project Name: - Target Device: - Tool versions: - Description:- Dependencies:- - Revision:- Revision 0.01 - File Created- Additional Comments:- -library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;- Uncomment the following library declaration if instantiating- any Xilinx primitives in this code.-library UNISIM;-use UNISIM.VComponents.all;entity sd is port (a,b: in std_logic_vector (4 downto 0); cin: in std_logic;s: out std_logic_vector(4 downto 0);cout: out std_logic);end sd;architecture Behavioral of sd is signal c:std_logic_vector(5 downto 0); signal p:std_logic_vector(4 downto 0); signal g:std_logic_vector(4 downto 0); beginp(0)=a(0) xor b(0);g(0)=a(0) and b(0);c(0)=cin;s(0)=p(0) xor c(0);p(1)=a(1) xor b(1);g(1)=a(1) and b(1);c(1)=(cin and p(0) or g(0);s(1)=p(1) xor c(1);p(2)=a(2) xor b(2);g(2)=a(2) and b(2);c(2)=(cin and p(0) and p(1) or (g(0)and p(1) or g(1);s(2)=p(2) xor c(2); p(3)=a(3) xor b(3);g(3)=a(3) and b(3);c(3)=(cin and p(0) and p(1)and p(2) or (g(0)and p(1) and p(2) or (g(1)and p(2) or g(2);s(3)=p(3) xor c(3);p(4)=a(4) xor b(4);g(4)=a(4) and b(4);c(4)=(cin and p(0) and p(1)and p(2)and p(3) or (g(0)and p(1) and p(2) and p(3) or (g(1)and p(2) and p(3) or (g(2)and p(3) or g(3);s(4)=p(4) xor c(4); c(5)=(cin and p(0) and p(1) and p(2)and p(3) and p(4) or (g(0)and p(1) and p(2) and p(3)and p(4) or (g(1)and p(2) and p(3) and p(4) or (g(2)and g(3) and p(4) or
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 天麻合同(标准版)
- 电线电缆行业知识培训课件
- SYB创业培训第三步评估你的市场
- 4.2整式的加减(3)-整式加减法则(说课稿新教材)-2024-2025学年七年级数学上册同步备课(人教版2024)
- 2025设备租赁合同登记流程范文
- 出纳录入合同
- 违法的劳动合同
- 贷款不还合同
- 体育赞助合同范本5篇
- Lesson 7教学设计-2025-2026学年小学英语六年级下册清华大学版
- 网络地址转换NAT
- 2021年子宫颈癌术后辅助治疗的规范化(全文)
- 学校运营分析报告范文
- 美术用品采购合同模板
- 2024~2025学年北师大版数学九年级上册 2.5一元二次方程的根与系数的关系 说课稿
- 2023年“达人英才计划”引才考试真题
- 蜗牛与黄鹂鸟(课件)人音版音乐二年级上册
- 铁路车辆电工(高级)职业技能鉴定考试题库(含答案)
- 七年级上册语文统编版 10 《往事依依》活动型公开课一等奖创新教学设计(表格式)
- 国有企业岗位劳动合同模板
- 人教版小学六年级上册数学期末测试卷及完整答案【名校卷】
评论
0/150
提交评论