1、library ieee;use ieee.std_logic_1164.all;entity tri_gate isport(din,en:in std_logic;dout:out std_logic);end;architecture one of tri_gate isbeginprocess(din,en)beginif en1 then dout=din;else dout=z;end if;end process;end;双向总线缓冲器library ieee;use ieee.std_logic_1164.all;entity tri_bibuffer isport(a,b:i
2、nout std_logic_vector(7 downto 0);en,dr:in std_logic);end;architecture one of tri_bibuffer issignal a_out,b_out:std_logic_vector(7 downto 0);beginprocess(a,b_out,en,dr)beginif en='1'and dr='1' then b_out=a;else b_out=“ZZZZZZZZ“;end if;b=b_out;end process;process(a_out,b,en,dr)beginif en='1'and dr='0' then a_out=b;else a_out=“ZZZZZZZZ“;end if;a=a_out;end process;end;