Forum Discussion
Altera_Forum
Honored Contributor
8 years agoImplement mux using for loop
Hi I think it is possible to implement a mux using a for loop like in the following example:
type array_type is array (7 downto 0) of std_logic_vector(15 downto 0);
signal mux_in: array...
Altera_Forum
Honored Contributor
8 years agoThis is because it fits the template for a priority encoder. Multiple ifs, with a default if one isnt hit, even though they are mutually exclusive. The technology view may have worked properly, but wont look nice.
This will give you a mux, as you expect, and work on any size: mux_out <= mux_in( to_integer( mux_slct) );