Forum Discussion
Altera_Forum
Honored Contributor
16 years ago2 to 1 Multiplexer Codes
I am going to post my VHDL codes for a 2 to 1 Multiplexer,im not sure if im heading the right way or not but i would like to get some feedback on what im doing. As you can see. SW(8) is my s ...
Altera_Forum
Honored Contributor
16 years agoWhat you are doing makes your code hard to read and difficult to understand. Theres also a very useful VHDL construct for muxes
why not separate it out so it reads alot easier: port ( s : in std_logic; x : in std_logic_vector(3 downto 0); y : in std_logic_vector(3 downto 0); op : out std_logic_vector(3 downto 0); ); architecture.... begin op <= x when s = '0' else y; end.