可编程逻辑器件及EDA技术实验报告

上传人:re****.1 文档编号:433166449 上传时间:2023-03-13 格式:DOC 页数:24 大小:1.84MB
返回 下载 相关 举报
可编程逻辑器件及EDA技术实验报告_第1页
第1页 / 共24页
可编程逻辑器件及EDA技术实验报告_第2页
第2页 / 共24页
可编程逻辑器件及EDA技术实验报告_第3页
第3页 / 共24页
可编程逻辑器件及EDA技术实验报告_第4页
第4页 / 共24页
可编程逻辑器件及EDA技术实验报告_第5页
第5页 / 共24页
点击查看更多>>
资源描述

《可编程逻辑器件及EDA技术实验报告》由会员分享,可在线阅读,更多相关《可编程逻辑器件及EDA技术实验报告(24页珍藏版)》请在金锄头文库上搜索。

1、可编程逻辑器件及EDA技术实验报告一、组合逻辑电路设计 数字逻辑电路按照逻辑功能的特点分为两类,一类是组合逻辑电路,简称为组合电路;另一类是时序逻辑电路,简称为时序电路。组合电路的特点是电路任意时刻输出状态只取决该时刻的输入状态,而与该时刻钱的电路状态无关。1、逻辑门电路设计实验原理:逻辑门电路包括基本逻辑门电路和符合逻辑门电路。VHDL语言可以直接支持的逻辑运算符共有七种逻辑运算,它们是: NOT 逻辑非 AND 逻辑与 NAND 逻辑与非 OR 逻辑或 NOR 或非 XOR 异或 XNOR 异或非实验内容:例3-2的参考程序:library ieee;use ieee.std_logic_

2、1164.all;use ieee.std_logic_arith.all;use ieee. std_logic_unsigned.all;entity example3_2 is port(a,b,c,d:in std_logic; f:out std_logic_vector(3 downto 0);end example3_2;architecture behavioral of example3_2 isbeginf(0)=(a and b)or(b and c)or(not b and not c);f(1)=(a and b and c)or not(not a or not b

3、 or not c);f(2)=(a xor b xor c)or(not(d)and(a or c);f(3)=not (a and b)xor (c and d)or(a and b and d)xor(b and c and d);end behavioral;实验分析:用逻辑运算符是实现了相对较为复杂的逻辑运算。参考程序中使用括号来强制控制逻辑运算的优先级,对于用VHDL设计,这种写法是必修的。用这种方法可以简单、快捷地完成逻辑电路设计。电路结构图:实验波形仿真如下图:2、常用编码器设计编码是指用文字、符号和数码等来表示某种信息的过程。在数字系统中,由于采用二进制运算来处理数据,因此通

4、常是将信息编成若干位二进制代码,而在逻辑电路中,信号都是以高、低电平的形式给出的。实现编码的数字电路称作编码器(encoder),编码器的逻辑功能就是把输入的每一个高低电平信号编成一组对应的二进制代码。实验原理:根据8线-3线优先编码器的真值表可得,优先编码器的编码输入、编码输出均为低电平有效,且有使能输入和使能输出功能。实验内容:例3.4试用VHDL设计一个8线-3线优先编码器,编码器输出为反码输出。它的程序如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_u

5、nsigned.all;entity example3_4 is port(sin:in std_logic; i:in std_logic_vector(7 downto 0); a:out std_logic_vector(2 downto 0); e,s:out std_logic);end example3_4;architecture behavioral of example3_4 isbegin process(sin,i) begin if sin=1 then a=111;e=1;s=1; else if i(7)=0 then a=000;e=0;s=1; elsif i(

6、6)=0 then a=001;e=0;s=1; elsif i(5)=0 then a=010;e=0;s=1; elsif i(4)=0 then a=011;e=0;s=1; elsif i(3)=0 then a=100;e=0;s=1; elsif i(2)=0 then a=101;e=0;s=1; elsif i(1)=0 then a=110;e=0;s=1; elsif i(0)=0 then a=111;e=0;s=1; else a=111;e=1;s segment segment segment segment segment segment segment segm

7、ent segment segment segment segment segment segment segment segment NULL ; END CASE ; END PROCESS ; END ;实验分析:当共阴极数码管的某一阳极接高电平时,相应的二极管发光,若要显示某字形,则使相应几段的二极管发光即可,所以共阴极数码管需要有输出高电平有效的译码器去驱动,而共阴极数码管则需要输出低电平有效的译码器去驱动。上面程序是一个能驱动共阳极数码管的7段译码器的VHDL程序。实验波形仿真如下:4、数据选择器设计 数据选择器(multiplexer)是在地址选择信号的控制下,从多路输入数据中选

8、择一路作为输出的逻辑电路,叫做多路开关,简称MUX。实验原理:在可编程逻辑器件的设计中经常用数据选择器来实现课编程逻辑器件内部数据总线的连接。实验内容:例3.7试用VHDL设计4选1数据选择器。参考程序:Library ieee;Use ieee.std_logic_1164.all;Use ieee.std_logic_arith.all;Use ieee.std_logic_unsigned.all;Entity example3_7 is Port(d:in std_logic_vector(3 downto 0); a:in std_logic_vector(1 downto 0);

9、e:in std_logic; f:out std_logic);end example3_7;architecture behavioral of example3_7 isbegin process(e,a,d) begin if e=0then case a is when 00 =ffff=d(3); end case; end if;end process;end behavioral;实验分析:一个4选1数据选择器,D3D0为4个数据输入,F为数据输出,A1、A0是地址选择输入。当A1、A0为不同代码时,D3D0中不同输入通道数据送至输出端F。E为使能端,当E=0时,数据选择器正常工作,否则禁止工作。实验波形仿真:

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 工作计划

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号