




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、深圳大学实验报告课程名称: VHDL 数字电路设计教程 实验项目名称: 5 位逐级进位和超前进位加法器设计 学院:信息工程学院专业: 电子信息工程指导教师:梁松海报告人:黄德荣 学号: 20006031459 班级: 1 班实验时间: 2008.10.22实验报告提交时间: 2008.11.5教务处制实验目的与要求 :用 XILINX ISE 7.1i 实现逐级进位和超前进位加法器方法、步骤:1,逐级进位加法器对每一位都使用了全加器 FAU,图中a和b是输入位, cin是进位输入位。 S是求和 的结果, cout 是进位输出位。 C 是进位矢量。图中每个全加器的输出结果都依赖于前一 级产生的进
2、位。由全加器的特性,可以写出如下的逻辑表达式: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), 那么相应的 gener
3、ate矢量为 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(
4、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- Desi
5、gn 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 fol
6、lowing library declaration if instantiating any Xilinx primitives in this code.-library UNISIM;-use UNISIM.VComponents.all;entity adder 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 adder;architecture Behavioral of adder is
7、 signal c:std_logic_vector(4 downto 0);begin c(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
8、(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
9、:- 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
10、 primitives in this code.-library UNISIM;-use UNISIM.VComponents.all;entity sd 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 sd;architecture Behavioral of sd issignal c:std_logic_vector(5 downto 0);signal p:std_logic_ve
11、ctor(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)
12、;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) o
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 预制厂安全教育课件
- 大学诚信文明主题教育
- 公务接待培训
- 项痹中医诊疗课件
- 钢笔画技能培训课件视频
- 健康饮食产业园项目环境影响报告书
- 宪法卫士 2024 第九届学宪法讲宪法活动高一高二高三学习练习答案
- 五年级写字课教案
- 息肉癌变基因编辑治疗
- 武冈辅警考试题库
- 2025年电工证考试试题及答案
- 2025年吉林省中考数学试卷真题及答案详解(精校打印版)
- DB15T 489-2019 石油化学工业建设工程技术资料管理规范
- 内蒙古自治区通辽市各县区乡镇行政村村庄村名居民村民委员会明细及行政区划代码
- 螺旋溜槽安装标准工艺
- 2022年人教版六年级下册语文期末考试卷
- 《土地开发整理项目预算编制暂行办法》
- 智能家居设备产业提质增效行动方案(参考意见稿)
- 安徽省评议公告的中小学教辅材料零售价格表
- 德龙自卸车合格证扫描件(原图)
- 西子otis梯oh con6423中文调试手册
评论
0/150
提交评论