library ieee;
use ieee.std_logic_1164.all;

entity four_sources is
    port (SW : in std_logic_vector(9 downto 0);
          LEDR : out std_logic_vector(9 downto 0));
end entity;

architecture rtl of four_sources is
    signal first_pair, second_pair : std_logic_vector(1 downto 0);
begin
    first_pair <= SW(7 downto 6) when SW(8) = '0' else SW(5 downto 4);
    second_pair <= SW(3 downto 2) when SW(8) = '0' else SW(1 downto 0);
    LEDR(1 downto 0) <= first_pair; -- TODO: choose a pair using SW(9).
    LEDR(9 downto 2) <= (others => '0');
end architecture;
