1|Page
For any Queries contact : digitronixnepali@gmail.com or +977-9841078525
VHDL Reference Guide Prepared by Digitronix Nepal
No. 1: And Gate and 3-bit decoder
AND Gate
entity and_gate_vhd is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
z : out STD_LOGIC);
end and_gate_vhd;
z<= a and b;
end Behavioral;
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY and_gate_tb IS
2|Page
For any Queries contact : digitronixnepali@gmail.com or +977-9841078525
VHDL Reference Guide Prepared by Digitronix Nepal
END and_gate_tb;
COMPONENT and_gate_vhd
PORT(
a : IN std_logic;
b : IN std_logic;
z : OUT std_logic
);
END COMPONENT;
--Inputs
signal a : std_logic := '0';
signal b : std_logic := '0';
signal z : std_logic;
BEGIN
-- Stimulus process
stim_proc: process
begin
-- hold reset state for 100 ns.
wait for 100 ns;
END;
3|Page
For any Queries contact : digitronixnepali@gmail.com or +977-9841078525
VHDL Reference Guide Prepared by Digitronix Nepal
4|Page
For any Queries contact : digitronixnepali@gmail.com or +977-9841078525