and4.vhd

来自「数字逻辑基础与Verilog设计,针对verilog语言的特点」· VHDL 代码 · 共 37 行

VHD
37
字号
LIBRARY IEEE;
USE IEEE.std_logic_1164.ALL;

ENTITY and_gate IS
           PORT (a,b  : IN  std_logic;
		   c  : OUT std_logic);
END and_gate;

ARCHITECTURE behave OF and_gate IS
BEGIN
             c <= a AND b;
END behave; 


LIBRARY IEEE;
USE IEEE.std_logic_1164.ALL;
--USE WORK.gate.ALL;

ENTITY and4 IS 
           PORT (a,b,c,d  : IN  std_logic;
		       q  : OUT std_logic);
END and4;

ARCHITECTURE structural OF and4 IS
         COMPONENT and_gate
            PORT (a  : IN  std_logic;
                  b  : IN  std_logic;
		  c  : OUT std_logic);
         END COMPONENT;
         SIGNAL  q1,q2  : std_logic;
BEGIN
	     U1:and_gate PORT MAP (a,b,q1);
	     U2:and_gate PORT MAP (c,d,q2);
	     U3:and_gate PORT MAP (q1,q2,q);    
END structural;	

⌨️ 快捷键说明

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