




已阅读5页,还剩40页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
山东大学信息科学与工程学院EDA实验报告姓 名: 吴蔓学 号:201400121184班 级:电信工一班 2016.5.31 实验1 4选1数据选择器的设计一、实验目的 1学习EDA软件的基本操作。 2学习使用原理图进行设计输入。 3初步掌握器件设计输入、编译、仿真和编程的过程。 4学习实验开发系统的使用方法。二、实验仪器与器材 1EDA开发软件 一套 2微机 一台 3实验开发系统 一台 4打印机 一台三、实验说明本实验通过使用基本门电路完成4选1数据选择器的设计,初步掌握EDA设计方法中的设计输入、编译、综合、仿真和编程的过程。实验结果可通过实验开发系统验证,在实验开发系统上选择高、低电平开关作为输入,选择发光二极管显示输出电平值。本实验使用Quartus II 软件作为设计工具,要求熟悉Quartus II 软件的使用环境和基本操作,如设计输入、编译和适配的过程等。实验中的设计文件要求用原理图方法输入,实验时,注意原理图编辑器的使用方法。例如,元件、连线、网络名的放置方法和放大、缩小、存盘、退出等命令的使用。学会管脚锁定以及编程下载的方法等。四、实验要求 1完成4选1数据选择器的原理图输入并进行编译; 2对设计的电路进行仿真验证; 3编程下载并在实验开发系统上验证设计结果。实验程序:library ieee;use ieee.std_logic_1164.all;entity mux4 isport (input:in std_logic_vector(3 downto 0); sel:in std_logic_vector(1 downto 0); y: out std_logic);end mux4;architecture rtl of mux4 isbeginprocess(sel,input)begin if sel=“00” then y=input(0); elsif sel=“01” then y=input(1); elsif sel=“10” then y=input(2); else yB)和L(AB)thenG=1;M=0;L=0;elsif(AB)thenG=0;M=0;L=1;elsif(A=B)thenG=0;M=1;L=0;elseG=1;M=1;L=1;end if;end process p1;end behave; 实验结果仿真波形图:功能:时序仿真:管脚分配: 实验3 并行加法器设计一、试验目的 1.设计一个4位加法器。 2.体会用VHDL进行逻辑描述的优点。 3,熟悉层次化设计方法。二、试验仪器与器材 1.EDA开发软件 一套 2.微机 一台 3.试验开发系统 一台 4.打印机 一台 5.其他器材和材料 若干三、试验说明本试验实现一个4位二进制数加法器,其功能框图如图所示。试验时用高低电平开关作为输入,用数码管作为输出(或用发光二极管),管脚锁定可根据试验系统自行安排。四、实验要求1用硬件描述语言编写4位二进制数全加器的源文件;2对设计文件进行编译;3仿真设计文件;4编程下载并进行试验验证。实验程序:library ieee; use ieee.std_logic_1164.all; entity add4 is port(a,b: in std_logic_vector(3 downto 0); cin: in std_logic; sum: out std_logic_vector(3 downto 0); count: out std_logic); end add4; architecture behavioral of add4 is begin process(a,b,cin) variable sum1: std_logic_vector(3 downto 0); variable carry: std_logic; begin carry:=cin; for i in 0 to 3 loop sum1(i):=(a(i) xor b(i) xor carry; carry:=(a(i) and b(i) or (carry and (a(i) or b(i); end loop; sum=sum1; count3,则表示通过。实验程序: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity seven is port( a:in std_logic_vector(6 downto 0); y:out std_logic); end seven; architecture one of seven is begin process(a) variable i:std_logic_vector(2 downto 0); begin i:=000; for j in 0 to 6 loop if(a(j)=1)then i:=i+1; else i:=i; end if; end loop; 译码程序: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity my_translate is port( a:in std_logic_vector(3 downto 0); rst:std_logic; dataout:out std_logic_vector(6 downto 0); end my_translate; architecture one of my_translate is begin process(a) begin case a is when0000=dataoutdataoutdataoutdataoutdataoutdataoutdataoutdataoutdataoutdataoutdataout3 then y=1; else y=0; end if; end process; end one;实验结果管脚分配:时序仿真:功能仿真实验5 计数器设计一、实验目的计数器是实际中最为常用的时序电路模块之一,本实验的主要目的是掌握使用HDL描述计数器类型模块的基本方法。二、实验仪器与器材1EDA开发软件 一套2微机 一台3实验开发系统 一台4打印机 一台5其他器材与材料 若干三、实验说明计数器是数字电路系统中最重要的功能模块之一,设计时可以采用原理图或HDL语言完成。下载验证时的计数时钟可选连续或单脉冲,并用数码管显示计数值。四、实验要求1设计一个带有计数允许输入端、复位输入端和进位输入端的十进制计数器。2编制仿真测试文件,并进行功能仿真。3下载并验证计数器功能。4为上述设计建立元件符号。5在上述基础上分别设计按8421BCD码和二进制计数的100进制同步计数器。实验程序十进制:方法一:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity cnt10 isport(res:in std_logic;clkin:in std_logic;ep:in std_logic;cout: out std_logic;sout:out std_logic_vector(3 downto 0);end cnt10;architecture behave of cnt10 issignal count :std_logic_vector(3 downto 0);begin process(res,clkin,ep)beginif(res=1) then count=0000;cout=0;elsif(ep=0 and rising_edge(clkin) thenif(count=1001)then cout=1;count=0000;else count=count+1;cout=0;end if;end if;end process;sout=count;end;方法二:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity count is port(clk:in std_logic;clr:in std_logic;en:in std_logic;q:out std_logic_vector(3 downto 0);cin:out std_logic);end count;architecture count of count is signal q0:std_logic_vector(3 downto 0);beginq=q0;process(clk,clr)beginif(clr=1)then q0=0000;cin=0;elsif(clkevent and clk=0)thenif(q0=1000)thenq0=q0+1;cin=1;else q0=q0+1;cin=0;if (q0=1001)thenq0data_outdata_outdata_outdata_outdata_outdata_outdata_outdata_outdata_outdata_outdata_outdata_outdata_outdata_outdata_outdata_out=1111111; end case; end process;end behave;分频器:LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;USE IEEE.STD_LOGIC_UNSIGNED.ALL;USE IEEE.STD_LOGIC_ARITH.ALL;ENTITY c ISGENERIC(N:INTEGER:=25);PORT(CLKIN:IN STD_LOGIC;CLKOUT:OUT STD_LOGIC);END c;ARCHITECTURE A OF MY_EDA_fpin ISSIGNAL CNT:STD_LOGIC_VECTOR(N-1 DOWNTO 0);BEGINPROCESS(CLKIN)BEGINIF(CLKINEVENT AND CLKIN=1)THENCNT=CNT+1;END IF;END PROCESS;CLKOUT=CNT(N-1);END A; 实验结果 十进制计数器原理图:计数模块:数码管模块100进制计数器原理图:管脚分配: 实验6 巴克码发生器一、实验目的1实现一个在通信领域中经常使用的巴克码发生器。2掌握用大规模可编程逻辑器件实现时序电路的方法。二、实验仪器与器材1EDA开发软件 一套2微机 一台3实验开发系统 一台4打印机 一台5其它器件与材料 若干三、实验说明巴克码发生器在数据通信、雷达和遥控领域有相当广泛的应用。它能自动产生周期性的序列码。本实验要求产生的序列码信号为(1110010),可以用寄存器或同步时序电路实现。为了能够通过实验开发系统验证试验结果,可以使用两个输入端,其中一个输出端同时输出巴克码,另一个输出端输出节拍。巴克码发生器的功能框图如图所示。四、实验要求1写出全部设计文件。2编写测试向量,进行功能仿真。3下载到实验开发系统上进行验证。实验程序分频器library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity fre_devider is generic(n:integer:=2500); port(clkin:in std_logic; clkout:out std_logic);end fre_devider;architecture one of fre_devider issignal counter:integer range 0 to n;signal clk:std_logic;begin process(clkin) begin if(rising_edge(clkin) then if (counter=n) then clk=not clk; counter=0; else counter=counter+1; end if; end if; end process; clkout=clk;end one;巴克码发生器library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity bakema is port(en,reset:in std_logic; clk:in std_logic; d:out std_logic; q:buffer std_logic_vector(3 downto 0); co,co2:out std_logic);end bakema;architecture one of bakema isbegin process(library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity fre_devider is generic(n:integer:=2500); port(clkin:in std_logic; clkout:out std_logic);end fre_devider;architecture one of fre_devider issignal counter:integer range 0 to n;signal clk:std_logic;begin process(clkin) begin if(rising_edge(clkin) then if (counter=n) then clk=not clk; counter=0; else counter=counter+1; end if; end if; end process; clkout=clk;end one;2、巴克码发生器library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity bakema is port(en,reset:in std_logic; clk:in std_logic; d:out std_logic; q:buffer std_logic_vector(3 downto 0); co,co2:out std_logic);end bakema;architecture one of bakema isbegin process(clk,en,reset) begin if (reset=1) then q=0000; elsif (rising_edge(clk) then if (en=1) then if (q=0110) then q=0000; else q=q+1; end if; end if; end if; end process; co=1 when(q=0110) else 0; co2ddddddddddddddddddd=0000110; end case; end process; end one;end one;实验结果 dingcengyuanlitutongguobianyi电路图:仿真波形图:管脚分配实验7 交通灯一、实验目的1.设计交通灯控制器2.学习状态机的设计方法二、实验仪器与器材1.EDA开发软件 一套2.微机 一台3.实验开发系统 一台4.打印机 一台5.其他器件与材料 若干三、实验说明有一交叉路口有两条通行道路,分别沿方向1和方向2通行。每一方向都有红黄绿组成的交通信号灯。这些信号灯由相应的高有效信号(R1,G1.Y1,R2,G2,Y2)来驱动。此外,每个方向上都有一个传感器,当相应方向上有车辆要求通过时,传感器给出高电平有效信号。具体要求:1.当SEN1和SEN2之一为1时,相应方向的绿灯点亮。2.SEN1和SEN2同时为1或为0时,两个方向的交通灯应循环点亮。3. 要求绿灯点亮时间为20S,黄灯点亮时间为5S。4. 按倒计时的方法用数码管指示灯亮时间。5. 在要求的时间段内,两个方向仅要求黄灯闪动。四、实验要求 1.画出控制器的ASM(MDS)图及设计的源文件。 2.进行仿真调试并写出仿真结果。 3.下载到实验开发系统上进行验证。实验程序:library ieee;use ieee.std_logic_unsigned.all;use ieee.std_logic_1164.all;entity fenpin is port(clk,clr:in std_logic; cout: out std_logic);end fenpin;architecture behave of fenpin is signal temp:integer:=0;signal clkout:std_logic; beginprocess beginwait until clk=1; if clr=1 then temp=0; clkout=0;elsif temp=25000000 then -the frequency of default clock is 50MHz clkout=not clkout;temp=0; elsetemp=temp+1; end if;end process; cout=clkout; end behave; 数码管显示:library ieee;use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity shumaguanxianshi isport(cin:in std_logic_vector(3 downto 0); clr:in std_logic;dispout:out std_logic_vector(6 downto 0); end shumaguanxianshi;architecture behave of shumaguanxianshi is begindispout=1111111 when clr=1 else 1000000 when cin=0000 else 1111001 when cin=0001 else 0100100 when cin=0010 else0110000 when cin=0011 else 0011001 when cin=0100 else 0010010 when cin=0101 else 0000010 when cin=0110 else 1111000 when cin=0111 else 0000000 when cin=1000 else 0010000 when cin=1001 else 0001000 when cin=1010 else 0000011 when cin=1011 else 1000110 when cin=1100 else 0100001 when cin=1101 else 0000110 when cin=1110 else 0001110 when cin=1111;end behave;:交通灯library ieee;use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all;entity jiaotongdeng isport(reset,ys,clk :in std_logic; -复位 闪烁 时钟sen1,sen2 :in std_logic; -状态控制 dxr,dxy,dxg :out std_logic; -东西方向灯 nbr,nby,nbg :out std_logic; -南北方向灯 dxhex,nbhex :out std_logic_vector(6 downto 0);kzm,kzn:instd_logic;anjian:instd_logic_vector(6 downto 0);end jiaotongdeng;architecture behave of jiaotongdeng is TYPE ZT IS(s0,s1,s2,s3);signalcurrent:ZT;signal dxh :std_logic_vector(6 downto 0); signal nbh :std_logic_vector(6 downto 0); -signal temp1:std_logic_vector(3 downto 0); -signal temp0:std_logic_vector(4 downto 0); beginprocess(clk,reset,sen1,sen2,ys,kzm,kzn)variable lvdeng :std_logic_vector(6 downto 0);variable huangdeng:std_logic_vector(6 downto 0);variable hongdeng:std_logic_vector(6 downto 0);beginif(kzm=0)then -把调节时间赋给变量 if(kzn=0)thenlvdeng :=anjian; elsehuangdeng:=anjian; end if;hongdeng:=lvdeng+huangdeng; end if; if clk=1and clkevent then if reset=1thencurrent=s0; -复位时进入第一个状态 dxh=hongdeng;nbhdxr=1; dxy=0; dxg=0; nbr=0; nby=0; nbg=1; if nbh=0000000 thennbh=huangdeng;current=s1; elsenbh=nbh-0000001; dxhdxr=1; dxy=0; dxg=0; nbr=0; nby=1; nbg=0; if dxh=0000000then dxh=lvdeng;nbh=hongdeng;current=s2; elsenbh=nbh-0000001; dxhdxr=0; dxy=0; dxg=1; nbr=1; nby=0; nbg=0; if dxh=0000000thendxh=huangdeng;current=s3; elsenbh=nbh-0000001; dxhdxr=0; dxy=1; dxg=0; nbr=1; nby=0; nbg=0; if dxh=0000000 then dxh=hongdeng; nbh=lvdeng; current=s0;else nbh=nbh-0000001; dxh=dxh-0000001;end if;end case;elsif(sen1=1)and (sen2=0) then dxh=0000000; nbh=0000000;dxr=0; dxy=0; dxg=1; nbr=0; nby=0; nbg=0;elsif(sen1=0)and(sen2=1) then dxh=0000000; nbh=0000000;dxr=0; dxy=0; dxg=0; nbr=0; nby=0; nbg=1; end if; end if;end process; dxhex=dxh; nbhex=1011010 then -90 temp1=1001;temp01010000 and temp(6 downto 0)1011010 then -80 temp1=1000;temp01000110 and temp(6 downto 0)1010000 then -70 temp1=0111;temp00111100 and temp(6 downto 0)1000110 then -60 temp1=0110;temp00110010 and temp(6 downto 0)0111100 then-50 temp1=0101;temp00101000 and temp(6 downto 0)0110010 then-40 temp1=0100;temp00011110 and temp(6 downto 0)0101000 then-30 temp1=0101;temp00001001 and temp
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025福建三明市属国企招聘项目负责人笔试历年参考题库附带答案详解
- 2025甘肃中电瓜州风力发电有限公司校园招聘笔试历年参考题库附带答案详解
- 2025河南南阳市西峡县宜居城镇工程建设有限公司招聘(第七号)笔试历年参考题库附带答案详解
- 2025年福建一建物业管理有限公司招聘劳务派遣工作人员笔试历年参考题库附带答案详解
- 2025安徽淮南焦岗湖投资集团有限公司政府投资工程审计人员招聘拟聘用人员笔试历年参考题库附带答案详解
- 2025广西河池市招聘中小学幼儿园教师565人模拟试卷及答案详解(名师系列)
- 2025广西柳州市柳江中学参加广西师范大学2025届研究生毕业生春季专场双选会招聘11人考前自测高频考点模拟试题及答案详解(易错题)
- 2025年上半年全省事业单位公开招聘工作人员(含教师)笔试南充考区模拟试卷及答案详解参考
- 2025江苏盐城工业职业技术学院招聘专职辅导员6人考前自测高频考点模拟试题附答案详解(考试直接用)
- 2025年甘肃省卫生健康委系统招聘工作人员网上缴费考前自测高频考点模拟试题附答案详解(黄金题型)
- 疏浚管线工技能操作考核试卷及答案
- 2025项目管理考试题及答案
- 医院手术室质控体系构建与管理
- 喷涂基础知识培训课件
- 2025年驻外内聘考试题库
- 中铁四局工作汇报与战略规划
- 矿山测量基础知识课件
- 【《上市公司财务造假分析的国内外文献综述》5100字】
- 企业融资培训课件
- 2025年抗菌药物合理使用培训
- GB/T 9113-2010整体钢制管法兰
评论
0/150
提交评论