Forum Discussion
Altera_Forum
Honored Contributor
16 years ago3 to 1 Multiplexer Codes
Here is my 3 to 1 Multiplexer Codes,from the instructions it was said that it must be built through a 2 to 1 Multiplexer and an extra input SW(8) and SW(9) are my inputs SW0-SW1 are my U,SW2-...
Altera_Forum
Honored Contributor
16 years agosince I've learnt some simplified ways,am i going the right way with this?
does it represent 3 to 1 mux? library ieee; use ieee.std_logic_1164.all; entity chiong2_1 is port (s : in std_logic_vector(1 downto 0); u : in std_logic_vector(1 downto 0); v : in std_logic_vector(1 downto 0); w : in std_logic_vector(1 downto 0); red:out std_logic_vector(7 downto 0); op : out std_logic_vector(1 downto 0)); end chiong2_1; architecture behavior of chiong2_1 is begin red<= s & u & v & w; op<= u when (s(0) ='0' and s(1) ='0') else v when (s(0) ='1' and s(1)='0') else w when (s(0) ='0' and s(1) ='1') else w; end behavior;