-- compon.vhd
-- desc: example syntax of package, component decl, library, use, component use

package components is

component AND_G is
  port( A1, A2 : in bit; Z1 : out );
end component;

-- other useful components, functions, procedures, constants, signals

end package;

--
-- assume package components above has been analyzed into a library called
--  'CMOS', the following example is using it
--

library cmos;
use cmos.components.and_g;   -- or .all to expose the entire library

entity and_gate is port ( a_in, b_in : in bit;
                          z : out bit );
end and_gate;

architecture structural of and_gate is
begin
U1:AND_G port map ( A1 => a_in, B1 => b_in, Z1 => z );
end structural;

<div align="center"><br /><script type="text/javascript"><!--
google_ad_client = "pub-7293844627074885";
//468x60, Created at 07. 11. 25
google_ad_slot = "8619794253";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />&nbsp;</div>