




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、验一:译码器及计数器设计实验 1、实验目的 1)复习二进制译码器的功能。 2)学习VHDL语言源程序输入方法。 3)学习VHDL语言源程序检查和修改。 4)掌握用VHDL语言设计一个3线-8线译码器和六十进制计数器的方法。 5)掌握VHDL语言编辑器的基本操作。 2、实验内容 1)本实验给出了有错误的3线一8线译码器的VHDL程序,请采用VHDL编辑器,修改调 试程序。 2)采用VHDL设计方法,设计一个60进制计数器,采用BCD码输出。 3、实验步骤 (一)、38译码器 1、分析38译码器原理,设计相应端口以及信号输入输出变量等。 2、 其中A、B、C为三位二进制代码输人端。Y0-Y7是八个
2、输出端,G1、G2A、G2B为三 个输入控制端。只有当 G1= 1,G2A = 0,G2B= 0时,译译码器才处于工作状态。否则、译 码器将处在禁止状态,所有输出端全为高电平。 3、 (二)、设计一个60进制计数器,采用BCD码输出。 1)BCD码:用4位二进制数编码表示1位十进制数 2) 一个十进制计数器即为一个4位二进制计数器,若将两个 4位二进制计数器连接起来 就可构成10C进制以内的计数器。 实验程序 1、3-8译码器 library IEEE; useUn comme nt the followi ng lines to use the declarati ons that are
3、- provided for instantiating Xilinx primitive components. architecture Behavioral of T138 is sig nal DN:stdo gic_vecto(2 dow nto 0); begi n D_INYYYYYYYYn ull; end case; else Y=; end if; end process; end Behavioral; 仿真结果: 2. 60进制计数器 实验程序: library IEEE; useUn comme nt the followi ng lines to use the d
4、eclarati ons that are - provided for instantiating Xilinx primitive components. -library UNISIM; -use jishuqi is port(clk:in stdogic; en ,clr:i n std_logic; q,qd:out std_logic_vector(3 downto 0); end jishuqi; architecture Behavioral of jishuqi is sig nal co:std_logic; sig nal ql,qh:std_logic_vector(
5、3 dow nto 0); begi n q( 3)=qh (3); q( 2)=qh (2); q(1)=qh(1); q(0)=qh(0); qd( 3)=ql(3); qd(2) =ql (2); qd(1)=ql(1); qd(O)v=ql(O); P1:process(clk,e n, clr) beg in if (clr=1) then ql=0000; elsif (clkevent and clk=1) then if (en=1) the n if (ql=1001) then ql=0000; else ql=ql+1; end if; end if; end if; e
6、nd process P1; co=ql(3) and ql(O); P2:process(clk,clr) beg in if (clr=1) then qh=0000; elsif (clkeve nt and clk=1) then if (co=1) the n if (qh=0101) then qh=0000; else qh=qh+1; end if; end if; end if; end process P2; end Behavioral; 仿真结果: 实验二、四位全加器和8位移位寄存器设计实验 1、实验目的 1)学习了解加法器工作原理。 2)学习用VHDL语言设计全加器的
7、设计方法。 3)学习使用元件例化的方法设计多位加法器。 4)了解移位寄存器的工作原理 5)学习移位寄存器设计方法 2、实验内容 1)用VHDL语言设计全加器。 2)用元件例化方法设计一个四位二进制加法器。 3)用VHDL语言设计一个双向可控移位寄存器 3、实验步骤 1) 4位二进制加法器可以由4个一位全加器通过级联的方式构成。 全加器:完成加数、被加数、低位的进位数三个1位数相加,并产生本位“和”及向高位 “进位”。 2) 移位寄存器是由D-型触发器构成的,将前一个触发器的输出作为下一个触发器的输 入,每个触发器的时钟连接成同步方式。常用的移位寄存器有并行输入串行输出移位寄存 器和串行输入并行
8、输出移位寄存器。这些移位寄存器经常用作串并转换电路。 试验程序: 1. 用元件例化方法设计一个四位二进制加法器。 全加器: library IEEE; useUn comme nt the followi ng lines to use the declarati ons that are - provided for instantiating Xilinx primitive components. -library UNISIM; -use quanjia is port (a,b,ci n:in std_logic; cout,sum:out std_logic); end quanj
9、ia; architecture Behavioral of quanjia is signal int: std_logic; begi n int = a xor b ; cout =(a and b) or (int and cin); sum = int xor cin; end Behavioral; 四位加法器: library IEEE; useUn comme nt the followi ng lines to use the declarati ons that are - provided for instantiating Xilinx primitive compon
10、ents. -library UNISIM; -use siwei is gen eric (n:i nteger:= 4 ); port (a,b:in std_logic_vector(n downto 1); cin: in std_logic; sum: out std_logic_vector( n dow nto 1); cout: out std_logic ); end siwei; architecture Behavioral of siwei is comp onent qua njia port (a,b,ci n:in std_logic; sum,cout:out
11、std_logic); end comp onent; signal carry: std_logic_vector(n downto 1); begi n U1: quanjia port map(a(1),b(1),ci n,sum(1),carry(1); U2: quanjia port map(a(2),b(2),carry(1),sum(2),carry(2); U3: quanjia port map(a(3),b(3),carry(2),sum(3),carry(3); U4: quanjia port map(a(4),b(4),carry(3),sum(4),cout);
12、end Behavioral; 实验截图: 2. 用VHDL语言设计一个8位双向可控移位寄存器。 程序代码: library IEEE; useUn comme nt the followi ng lines to use the declarati ons that are -provided for instantiating Xilinx primitive components. -library UNISIM; -use yiwei is port(Dim:in std_logic; S:in std_logic; clk:in std_logic; Q:out stdo gic_vector(7 dow nto 0); end yiwei; architecture Behavioral of yiwei is sig nal qtemp:std_logic_vector(7 do
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 米、面制品的电子商务与网络营销考核试卷
- 跨文化沟通与国际合作考核试卷
- 连锁酒店品牌形象宣传手段研究考核试卷
- 谷物磨制企业产品创新与市场竞争能力考核试卷
- 棉花加工设备的声学降噪技术考核试卷
- 新育儿护理方法实践指南
- 影视作品烟雾机租赁与特效制作合同
- 高效冲击试验机租赁及材料抗冲击性能改进合同
- 区块链智能合约法律审查与合同执行监督合同
- 模块化建筑幕墙胶缝更换与装配式建筑合同
- 《企业会计准则第22号-金融工具确认和计量》应用指南2023年
- 水和电解质代谢(生物化学课件)
- SG-T048-结构吊装施工记录
- 温岭市国有企业招聘考试真题2022
- 神木县四门沟煤矿矿山地质环境保护与土地复垦方案
- 2023年广西三类人员B证继续教育网络学习试题及答案分DOC
- 人教版七年级上生命的思考珍视生命微课
- 数学手册(高清版)
- 《安井食品采购成本管理问题研究【开题报告+文献综述+正文】》17000字
- 义务教育语文课程标准(2022)测试题带答案(20套)
- 招聘与配置课程心得体会5篇
评论
0/150
提交评论