⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nand_2.vhd

📁 初学VHDL有用的
💻 VHD
字号:

--与非门多结构体的配置

LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
--*******************************
ENTITY nand_2 IS
		PORT(
		a,b: IN	bit;
				y: OUT	bit);
END nand_2;
--*******************************

ARCHITECTURE rtl OF nand_2 IS
begin
   y<=not(a and b);
end rtl;
--**********************************
ARCHITECTURE struct OF nand_2 IS
component inv_comp
     port(a:in bit;
           c:out bit);
     end component;
component and2_comp
     port(a,b:in bit;
           c:out bit);
     end component;
signal out1:bit;
begin
    u1:and2_comp port map(a,b,out1);
    u2:inv_comp port map(out1,y);	
END struct;
--***********************************
ARCHITECTURE behav OF nand_2 IS
begin
   process(a,b)
    variable tmp: bit_vector(1 downto 0);
    begin 
      tmp:=a&b;
      case tmp is
       when"00"=>y<='1';
       when"01"=>y<='1';
       when"10"=>y<='1';
       when"11"=>y<='0';
    end case;
end process;
end behav;
--*************************************

configuration nand2_con of nand_2 is
    for rtl
    end for;
end nand2_con;



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -