代码如下
- --2shuruyufeimen
- library ieee;
- use ieee.std_logic_1164.all;
- entity nand2 is
- port(a,b: in std_logic;
- y:out std_logic);
- end entity nand2;
- architecture nand22 of nand2 is
- begin
- y<=a NAND b;
- end architecture nand22;
- --3shuruyufeimen
- library ieee;
- use ieee.std_logic_1164.all;
- entity nand3 is
- port(a,b,c: in std_logic;
- y:out std_logic);
- end entity nand3;
- architecture nand33 of nand3 is
- begin
- y<=NOT(a AND b AND c);
- end architecture nand33;
- --3shurubiaojueqi
- library ieee;
- use ieee.std_logic_1164.all;
- entity nand4 is
- port(ain,bin,cin: in std_logic;
- yout:out std_logic);
- end entity nand4;
- architecture nand44 of nand4 is
- component nand2
- port(a,b: in std_logic;
- y:out std_logic);
- end component nand2;
- component nand3
- port(a,b,c: in std_logic;
- y:out std_logic);
- end component nand3;
- signal e,f,g:std_logic;
- begin
- u1:nand2 port map(a>=ain,b>=bin,y>=e);
- u2:nand2 port map(a>=ain,b>=cin,y>=f);
- u3:nand2 port map(a>=bin,b>=cin,y>=g);
- u4:nand3 port map(a>=e,b>=f,c>=g,y>=yout);
- end architecture nand44;
复制代码
错误显示 object a,b,c is used but not declared
一周热门 更多>