No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Test_MUX.vhd 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. ----------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date: 17.04.2021 22:43:43
  6. -- Design Name:
  7. -- Module Name: Test_MUX - Behavioral
  8. -- Project Name:
  9. -- Target Devices:
  10. -- Tool Versions:
  11. -- Description:
  12. --
  13. -- Dependencies:
  14. --
  15. -- Revision:
  16. -- Revision 0.01 - File Created
  17. -- Additional Comments:
  18. --
  19. ----------------------------------------------------------------------------------
  20. library IEEE;
  21. use IEEE.STD_LOGIC_1164.ALL;
  22. -- Uncomment the following library declaration if using
  23. -- arithmetic functions with Signed or Unsigned values
  24. --use IEEE.NUMERIC_STD.ALL;
  25. -- Uncomment the following library declaration if instantiating
  26. -- any Xilinx leaf cells in this code.
  27. --library UNISIM;
  28. --use UNISIM.VComponents.all;
  29. entity Test_MUX is
  30. -- Port ( );
  31. end Test_MUX;
  32. architecture Behavioral of Test_MUX is
  33. component MUX is
  34. Generic (Nb_bits : Natural;
  35. Instruction_Vector_Size : Natural;
  36. Bits_Controle : STD_LOGIC_VECTOR);
  37. Port ( Instruction : in STD_LOGIC_VECTOR (Instruction_Vector_Size - 1 downto 0);
  38. IN1 : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
  39. IN2 : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
  40. OUTPUT : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0));
  41. end component;
  42. signal my_Instruction : STD_LOGIC_VECTOR (3 downto 0) := (others => '0');
  43. signal my_IN1 : STD_LOGIC_VECTOR (15 downto 0);
  44. signal my_IN2 : STD_LOGIC_VECTOR (15 downto 0);
  45. signal my_OUTPUT : STD_LOGIC_VECTOR (15 downto 0);
  46. begin
  47. instance : MUX
  48. generic map (Nb_bits => 16,
  49. Instruction_Vector_Size => 4,
  50. Bits_Controle => x"aaaa")
  51. port map (
  52. Instruction => my_Instruction,
  53. IN1 => my_IN1,
  54. IN2 => my_IN2,
  55. OUTPUT => my_OUTPUT
  56. );
  57. process
  58. begin
  59. my_IN1 <= x"abcd";
  60. my_IN2 <= x"1234";
  61. my_Instruction <= "0000" after 1 ns, "0001" after 2 ns, "0010" after 3 ns, "0011" after 4 ns, "0100" after 5 ns, "0101" after 6 ns, "0110" after 7 ns, "0111" after 8 ns;
  62. wait;
  63. end process;
  64. end Behavioral;