Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LIBRARY ieee;
- USE ieee.std_logic_1164.ALL;
- -- Uncomment the following library declaration if using
- -- arithmetic functions with Signed or Unsigned values
- --USE ieee.numeric_std.ALL;
- ENTITY mux_7x1_test IS
- END mux_7x1_test;
- ARCHITECTURE behavior OF mux_7x1_test IS
- -- Component Declaration for the Unit Under Test (UUT)
- COMPONENT mux_7x1
- PORT(
- A : IN std_logic_vector(3 downto 0);
- B : IN std_logic_vector(3 downto 0);
- C : IN std_logic_vector(3 downto 0);
- D : IN std_logic_vector(3 downto 0);
- E : IN std_logic_vector(3 downto 0);
- F : IN std_logic_vector(3 downto 0);
- G : IN std_logic_vector(3 downto 0);
- Result : OUT std_logic_vector(3 downto 0);
- Select_Port : IN std_logic_vector(2 downto 0)
- );
- END COMPONENT;
- --Inputs
- signal A : std_logic_vector(3 downto 0) := (others => '0');
- signal B : std_logic_vector(3 downto 0) := (others => '0');
- signal C : std_logic_vector(3 downto 0) := (others => '0');
- signal D : std_logic_vector(3 downto 0) := (others => '0');
- signal E : std_logic_vector(3 downto 0) := (others => '0');
- signal F : std_logic_vector(3 downto 0) := (others => '0');
- signal G : std_logic_vector(3 downto 0) := (others => '0');
- signal Select_Port : std_logic_vector(2 downto 0) := (others => '0');
- --Outputs
- signal Result : std_logic_vector(3 downto 0);
- -- No clocks detected in port list. Replace <clock> below with
- -- appropriate port name
- -- constant <clock>_period : time := 10 ns;
- BEGIN
- -- Instantiate the Unit Under Test (UUT)
- uut: mux_7x1 PORT MAP (
- A => A,
- B => B,
- C => C,
- D => D,
- E => E,
- F => F,
- G => G,
- Result => Result,
- Select_Port => Select_Port
- );
- -- Clock process definitions
- -- <clock>_process :process
- -- begin
- -- <clock> <= '0';
- -- wait for <clock>_period/2;
- -- <clock> <= '1';
- -- wait for <clock>_period/2;
- -- end process;
- -- Stimulus process
- stim_proc: process
- begin
- Select_Port <= "001";
- wait for 50 ns;
- A <= "0001";
- wait for 50 ns;
- Select_Port <= "010";
- wait for 50 ns;
- B <= "0010";
- wait for 50 ns;
- Select_Port <= "011";
- wait for 50 ns;
- C <= "0011";
- wait for 50 ns;
- Select_Port <= "100";
- wait for 50 ns;
- D <= "0100";
- wait for 50 ns;
- Select_Port <= "101";
- wait for 50 ns;
- E <= "0101";
- wait for 50 ns;
- Select_Port <= "110";
- wait for 50 ns;
- F <= "0110";
- wait for 50 ns;
- Select_Port <= "111";
- wait for 50 ns;
- G <= "0111";
- wait for 50 ns;
- Select_Port <= "000";
- wait for 300 ns;
- end process;
- END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement