EDA实验小论文.doc_第1页
EDA实验小论文.doc_第2页
EDA实验小论文.doc_第3页
EDA实验小论文.doc_第4页
EDA实验小论文.doc_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

EDA实验小论文姓名 石利芳 班级 08级电科(2)班 学号 0808101035 2011年12月实验一、组合电路-译码器的设计一、实验目的了解EDA实验箱分别用电路图和VHDL语言设计译码器的原理,掌握组合逻辑电路的设计方法,初步了解可编程器件的设计全过程,设计相应的译码器模块。二、硬件要求主芯片Altera EPM7128SLC84-15,时钟信号,三位拨码开关。三、实验内容 首先输入电路的原理图,然后选择芯片型号,进行编译适配,再添加仿真激励波形,进行电路仿真和时序分析,观察波形,正确后编程下载实验测试。四、实验原理用三位拨码开关代表译码器的输入端A、B、C,将之分别与EPM7128SLC84-15芯片的相应管脚相连;用LED灯来表示译码器的输出,将D0.D7对应的管脚分别与8只LED灯相连。试验结果如下:ABCLED0LED1LED2LED3LED4LED5LED6LED7000亮灭灭灭灭灭灭灭100灭亮灭灭灭灭灭灭010灭灭亮灭灭灭灭灭110灭灭灭亮灭灭灭灭001灭灭灭灭亮灭灭灭101灭灭灭灭灭亮灭灭011灭灭灭灭灭灭亮灭111灭灭灭灭灭灭灭亮五、实验源程序library ieee;use ieee.std_logic_1164.all;-库函数声名entity decoder3_8 is port(a,b,c,g1,g2a,g2b:in std_logic; y:out std_logic_vector(7 downto 0);end ; -实体即输入输出端口定义architecture rtl of decoder3_8 is -结构体描述 signal dz:std_logic_vector(2 downto 0); begin dzyyyyyyyyy=XXXXXXXX; end case;else y0);-计数器异步复位 elsif clkevent and clk=1 then if en=1 then -检测是否允许计数 if ci0); -等于15,计数值清零 end if; end if; cq=ci; end if; if ci=1111 then cout=1; -输出进位信号 else cout=0; end if; end process;end behave; (3) 用原理图法实现模16减法计数器D触发器JK触发器(4) 用VHDL实现模16 减法计数器 (5) 计数器的级连:分别用VHDL语言实现模10和模6计数器,然后通过顶层电路调用模10和模6计数器,产生模60进制计数器。10进制计数器源程序:cnt10.vhdlibrary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity cnt10 isport(clk,rst,en: in std_logic; sum: out integer range 15 downto 0; cout1: out std_logic); end cnt10;architecture a of cnt10 issignal count: integer range 15 downto 0;beginprocess(clk,rst)begin if rst=0 then count=0; elsif rising_edge(clk) then if en=1 then if count=9 then count=0; else count=count+1; end if ; end if; end if;end process;sum=count;cout1=1 when en=1 and count=0 else 0;end a;6进制计数器源程序::cnt6.vhdlibrary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity cnt6 isport(clk,rst,en: in std_logic; sum: out integer range 7 downto 0; cout2: out std_logic); end cnt6;architecture a of cnt6 issignal count: integer range 7 downto 0;beginprocess(clk,rst)begin if rst=0 then count=0; elsif rising_edge(clk) then if en=1 then if count=5 then count=0; else count=count+1; end if ; end if; end if;end process;sum=count;cout240Hz)t3.gdf2、实验连线输入信号:把RESET和rst0接高电平,CLK接上时钟信号。输出信号:代表七段数码驱动信号LED7S的06管脚分别同扫描数码管的段输入a,b,c,d,e,f,g相连。五、实验源程序 (1) 字符译码器DECL7S的VHDL源程序library ieee;use ieee.std_logic_1164.all;entity decl7s is port(a:in std_logic_vector(3 downto 0); led7s:out std_logic_vector(6 downto 0); end;architecture one of decl7s isbegin process(a) begin case a is when 0000 = led7s led7s led7s led7s led7s led7s led7s led7s led7s led7s null; end case; end process;end;(2) 10进制4位计数器的VHDL源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity cnt4b is port(clk,rst,en : in std_logic; cq : out std_logic_vector(3 downto 0); cout : out std_logic );end cnt4b;architecture behave of cnt4b isbegin process(clk,rst,en) variable ci:std_logic_vector(3 downto 0); begin if rst=1 then ci:=(others=0);-计数器异步复位 elsif clkevent and clk=1 then if en=1

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论