






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







2 n^ AND gates = 4 AND gates n Inverters = 2 Inverters (^) Showing more inverters than necessary to illustrate concept
entity and2 is port (In1,In2 : in STD_LOGIC; Out1 : out STD_LOGIC); end entity and2;
architecture and2_arch of and2 is begin Out1 <= In1 and In2; end architecture and2_arch;
entity decoder_2to4 is port (A,B : in STD_LOGIC; Y0,Y1,Y2,Y3 : out STD_LOGIC); end entity decoder_2to4;
begin U1 : inv port map (A, A_n); U2 : inv port map (B, B_n);
U3 : and2 port map (A_n, B_n, Y0); U4 : and2 port map (A, B_n, Y1); U5 : and2 port map (A_n, B, Y2); U6 : and2 port map (A, B, Y3);
end architecture decoder_2to4 _arch;
ex) width of bus, delay, loop counters,
syntax: constant (const-name : const-type := init-val) ;
NOTE: init-val is NOT optional
ex) architecture inv_n_arch of inv_n is
constant (t_dly : time := 1ns);
begin Out1 <= not In1 after t_dly;
end architecture inv_n_arch;