EDA与数电第三章对比总结详解.pptVIP

  • 12
  • 0
  • 约 73页
  • 2016-09-20 发布于湖北
  • 举报
EDA技术及应用总结 第三章 基本逻辑单元的VHDL模型 贺晓英 电子信息工程 1206班 20120506628 一、组合逻辑电路设计 1、组合逻辑电路与时序逻辑电路的区别: 组合逻辑电路只与当前状态有关,而时序逻辑电路不仅与当前状态有关,还与输入状态有关。 2、编码器 用的最多的是优先编码器。优先编码器不能用case语句,因为case语句没有优先级,用if语句或条件信号赋值语句。 VHDL优先编码器 library ieee; use ieee.std_logic_1164.all; entity encoder is port (a,b,c,d,e,f,g,h:in std_logic; codeout:out std_logic_vector(2 downto 0)); end encoder ; architecture rtl of encoder is begin encoder = 111 when h = 1 else; 110 when g = 1 else; 101 when f = 1else; 100 when e = 1 else; 011 when d = 1 else; 010 when c= 1 else; 001 when b= 1else; 000 when a= 1 else; 000 end behave; 数电:二进制优先编码器 真值表: 3、译码器 VHDL:3-8译码器 library ieee; use ieee.std_logic_1164.all; entity decoder is port (a,b,c,g1,g2a,g2b:in std_logic; y:out std_logic_vector(7 downto 0)); end decoder; architecture rtl of decoder is begin indata =cba; process(indata,g1,g2a,g2b) case sel is if(g1=1and g2a=0 and g2b=0)then when 000 = y when 001 = y when 000 = y when 001 = y when 010 = y when 011 = y when 100 = y when 101 = y when 110 = y when 111 = y when others = y end case; else y end if; end process; end ; 4、数据选择器 (1)、if语句 四选一电路 architecture rtl of ifmux is begin process(input, sel) is begin if (sel = 00) then y = input(0); elsif (sel=01) then y = input(1); elsif (sel= 10) then y = input(2); (2)、case语句 四选一电路 library ieee; use ieee.std_logic_1164.all; entity mux4 is port(input: in std_logic_vector(3 downto 0); sel: in std_logic_vector(1 downto 0); y: out std_logic); end entity mux4; architecture mux4_behave of mux4 is begin process(sel, input) is begin case语句 四选一电路 (3)、条件信号赋值语句 四选一电路

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档