




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、数字系统设计实验报告 班级:计算机 姓名: 学号: 计数器设计实验1、实验目的 1)学习计数器不同设计方法。 2)学习掌握vhdl中不同输出类型在具体应用时的区别(out、inout、buffer)。 3)学习掌握时序电路仿真方法。2、实验内容 1)采用vhdl设计方法,设计一个60进制计数器,采用bcd码输出。 2)给出上述设计的仿真结果。3、实验设备1)清华同方p 2.4g256m60g2)ise 6.2iwindows软件系统4、实验步骤1)创建工程2)程序输入3)仿真5、实验程序library ieee;use ieee.std_logic_1164.all;use ieee.std_
2、logic_arith.all;use ieee.std_logic_unsigned.all;entity cm isport(ai,bi,cin:in std_logic; si,cio: out std_logic);end cm;architecture behavioral of cm isbeginsi=(ai xor bi)xor cin;cio=(ai and bi)or(cin and ai)or(cin and bi);end behavioral;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_ari
3、th.all;use ieee.std_logic_unsigned.all;- uncomment the following lines to use the declarations that are- provided for instantiating xilinx primitive components.-library unisim;-use unisim.vcomponents.all;entity mn isport(a,b:in std_logic_vector(3 downto 0); ci:in std_logic; co:out std_logic; s:out s
4、td_logic_vector(3 downto 0);end mn;architecture behavioral of mn iscomponent cmport(ai,bi,cin:in std_logic; si,cio:out std_logic);end component;signal carry:std_logic_vector(4 downto 0);begincarry(0)=ci;co=carry(4);add1: cm port map(a(0),b(0),carry(0),s(0),carry(1);add2: cm port map(a(1),b(1),carry(
5、1),s(1),carry(2);add3: cm port map(a(2),b(2),carry(2),s(2),carry(3);add4: cm port map(a(3),b(3),carry(3),s(3),carry(4);end behavioral;6、 实验仿真结果实验二、加法器设计实验1、实验目的 1)学习了解加法器工作原理。 2)学习用vhdl语言设计全加器的设计方法。 3)学习使用元件例化的方法设计多位加法器。2、实验原理 两个n位二进制数相加的过程,是从最低有效位开始相加,形成和数并传送进位最后得到结果。最低位只有加数和被加数相加,这种两个一位数相加称为半加;完成加
6、数、被加数、低位的进位数三个一位数相加称为全加。实现半加运算的电路称为半加器,实现全加运算的电路称为全加器。3、实验内容 1)用vhdl语言设计全加器。 2)用元件例化方法设计一个四位二进制加法器。4、实验设备 1)清华同方p 2.4g256m60g 2)ise 6.2iwindows软件系统5、实验步骤1)创建工程2)程序输入3)仿真6. 实验程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;- uncomment the follow
7、ing lines to use the declarations that are- provided for instantiating xilinx primitive components.-library unisim;-use unisim.vcomponents.all;entity fulladder is port(ai,bi,cin:in std_logic;si,cio:out std_logic);end fulladder;architecture behavioral of fulladder isbegin si=(ai xor bi) xor cin; cio=
8、(ai and bi)or(ai and cin)or(bi and cin);end behavioral;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;- uncomment the following lines to use the declarations that are- provided for instantiating xilinx primitive components.-library unisim;-use u
9、nisim.vcomponents.all;entity four is port ( a,b : in std_logic_vector(3 downto 0); ci : in std_logic; co : out std_logic; s : out std_logic_vector(3 downto 0);end four;architecture behavioral of four iscomponent fulladder port(ai,bi,cin:in std_logic;si,cio:out std_logic);end component;signal carry:s
10、td_logic_vector(4 downto 0);begincarry(0)=ci;coa(i),bi=b(i),cin=carry(i),si=s(i),cio=carry(i+1);end generate gen;end behavioral;7.仿真结果数字系统设计第三次实验简易数字钟设计实验1、实验目的 1)学习vhdl语言源程序输入方法。 2)学习使用元件例化的方法设计简易数字钟。 3)进一步加深对仿真过程和仿真结果的理解。2、实验原理数字钟是对输入时基秒脉冲进行计数,依次输出秒数值、分数值、小时数值,从而确定时钟时间。3、实验内容 1)建立一个新的 工程。 2)在上述工程中
11、,采用vhdl语言的方 法设计上述简易数字钟。 3) 通过仿真来验证设计结果。4、 实验设备 1)清华同方p 2.4g256m60g 2)ise 6.2iwindows软件系统 3)多功能eda实验系统(v型)5、实验报告要求 1)实验目的、实验内容、实验设备、实验步骤。 2)写出设计程序。 3)画出简易数字钟的仿真波形。6源程序:use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;- uncomment the following lines to use the d
12、eclarations that are- provided for instantiating xilinx primitive components.-library unisim;-use unisim.vcomponents.all;entity counter24 is port ( en,clk,temp : in std_logic; qh,ql : out std_logic_vector(3 downto 0); qcc : out std_logic);end counter24;architecture behavioral of counter24 issignal t
13、emp_h:std_logic_vector(3 downto 0) := 0010;signal temp_l:std_logic_vector(3 downto 0) := 0011;beginprocess(en,clk)beginif clk=1and clkevent thenif en = 1 and temp=1thenif temp_l=0011and temp_h = 0010 thentemp_l = 0000;temp_h = 0000;elseif temp_l=1001 thentemp_l = 0000;temp_h = temp_h + 1;elsetemp_l
14、= temp_l + 1;end if;end if;end if;end if;end process;qh = temp_h;ql = temp_l;qcc = (not temp_l(3) and (not temp_l(2) and temp_l(1) and temp_l(0) and (not temp_h(3) and (not temp_h(2) and temp_h(1) and (not temp_h(0);end behavioral;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all
15、;use ieee.std_logic_unsigned.all;- uncomment the following lines to use the declarations that are- provided for instantiating xilinx primitive components.-library unisim;-use unisim.vcomponents.all;entity counter60 is port ( clk, en,clr : in std_logic; qh,ql : out std_logic_vector (3 downto 0); qcc:
16、 out std_logic);end counter60;architecture behavioral of counter60 issignal qccl: std_logic;signal qtempl:std_logic_vector (3 downto 0) ;signal qtemph:std_logic_vector (3 downto 0) ;beginql=qtempl;qccl=qtempl(3) and not qtempl(2) and not qtempl(1) and qtempl(0) ;qh=qtemph;qcc=(not qtemph(3) and qtem
17、ph(2) and (not qtemph(1) and qtemph(0) and qtempl(3) and not qtempl(2) and not qtempl(1) and qtempl(0);p1:process(clk,en,clr)beginif clr=1 then qtempl=1000;elseif clkevent and clk=1 thenif en=1 thenif qtempl=1001 thenqtempl=0000;elseqtempl=qtempl+1;end if;end if;end if;end if;end process p1;p2:proce
18、ss(clk,clr)beginif clr=1 then qtemph=0101;elseif clkevent and clk=1 thenif qccl=1and en = 1 thenif qtemph=0101 thenqtemph=0000;elseqtemph=qtemph+1;end if;end if;end if;end if;end process p2;end behavioral;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsign
19、ed.all;- uncomment the following lines to use the declarations that are- provided for instantiating xilinx primitive components.-library unisim;-use unisim.vcomponents.all;entity shuzizhong is port ( clr,enble,clk : in std_logic; output1,output2 : out std_logic_vector(3 downto 0); output3,output4 : out std_logic_vector(3 downto 0); output5,output6 : out std_logic_vector(3 downto 0); qcc : out std_logic);end shuzizhong;architecture behavioral of shuzizhong iscomponent
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 园林专业造价试题及答案
- 闵行区老旧厨房施工方案
- 时尚产业全球市场布局研究
- 互联网营销方案
- 网络安全威胁防范策略探讨
- 网络经纪合同
- 山东省日照市校际联合考试2024-2025学年高二上学期11月期中考试地理试卷(含答案)
- 建设天桥围栏施工方案
- 灰土防弹墙施工方案
- 湖北交通标牌施工方案
- 剖宫产术后腹胀护理
- 项目部商务管理办法
- 2025重庆医科大学附属第一医院(编制外)招聘18人考试参考试题及答案解析
- 精麻药品培训知识课件
- 2025细胞与基因治疗科研领域蓝皮书
- 2025年高考语文全国二卷真题拓展:语言文字运用“衔接+感情色彩+关联词语+错别字”
- 2025年司法考试题库(附答案)
- 仪表工安全基础知识培训课件
- ISO9001质量管理体系培训
- 光电检测技术及应用 周秀云
- 2025至2030中国糠醛衍生物市场未来趋势及发展态势展望报告
评论
0/150
提交评论