library ieee; use ieee.std_logic_1164.all; entity Multiplexeur is port( IN0,IN1,IN2,IN3,IN4: in std_logic_vector(7 downto 0); Selecteur : in std_logic_vector(2 downto 0); Sortie : out std_logic_vector(7 downto 0) ); end Multiplexeur; --architecture ConcSelect of Multiplexeur is --begin --with Selecteur select --Sortie <= IN0 when "00", -- IN1 when "01", -- IN2 when "10", -- IN3 when "11", -- IN0 when others; --end ConcSelect; --Solution possible aussi : --architecture Archif of Multiplexeur is --begin -- process(Selecteur, IN0, IN1, IN2, IN3) -- --process all -VHDL 2008 -- begin -- if Selecteur = "00" then -- Sortie <= IN0; -- elsif Selecteur = "01" then -- Sortie <= IN1; -- elsif Selecteur = "10" then -- Sortie <= IN2; -- elsif Selecteur = "11" then -- Sortie <= IN3; -- else -- Sortie <= (others => '0'); -- end if; -- end process; --end Archif; architecture CaseProcess of Multiplexeur is begin process(all) begin case Selecteur is when "000" => Sortie <= in0; when "001" => Sortie <= in1; when "010" => Sortie <= in2; when "011" => Sortie <= in3; when "100" => Sortie <= in4; when others => Sortie <= in0; end case; end process; end CaseProcess;