Muxes : 64X1

G

Gary Olson

Guest
Question I have is I need a 42X1 Mux <BR>
Actually I am muxing 42 16 bit databusses. The Timing is critical <BR>
because the 42 16 bit words are read by a microcontroller. I am wondering the best way to MUX theses signals. I could use a 64X1 mux and syntesize out unused logic. <p>Or I could use a 32X1, 16X1 with a 2X1 to merge the two muxed data paths. <p>Does it make any difference at all what I do? Any other alternative approaches? <p>Thank You, <BR>
Gary Olson
 
I meant the timing is not critical because I am reading the Mux output with a Microcontroller.
 
Gary,
Ken Chapman of Xilinx wrote a TechXclusive about Multiplexers. It's worth a
read.
cheers, Syms.
 
Here is my VHDL <p>library IEEE; <BR>
use IEEE.STD_LOGIC_1164.all; <p>entity MUX42 is <BR>
port ( <BR>
dIn_0 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_1 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_2 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_3 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_4 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_5 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_6 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_7 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
dIn_8 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_9 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_10 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_11 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_12 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_13 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_14 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_15 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
dIn_16 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_17 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_18 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_19 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_20 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_21 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_22 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_23 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
dIn_24 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_25 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_26 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_27 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_28 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_29 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_30 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_31 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_32 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_33 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_34 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_35 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_36 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_37 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
dIn_38 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_39 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_40 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_41 : in STD_LOGIC_VECTOR (15 downto 0); <BR>
sel_0 : in STD_LOGIC; -- select mux input <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sel_1 : in STD_LOGIC; -- select mux input <BR>
sel_2 : in STD_LOGIC; -- select mux input <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sel_3 : in STD_LOGIC; -- select mux input <BR>
sel_4 : in STD_LOGIC; -- select mux input <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sel_5 : in STD_LOGIC; -- select mux input <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dOut : out STD_LOGIC_VECTOR (15 downto 0) <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;); <BR>
end MUX42; <p>--}} End of automatically maintained section <p>architecture MUX42 of MUX42 is <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;signal adr: std_logic_vector(5 downto 0); <BR>
begin <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;adr &lt;= sel_5 &amp; sel_4 &amp; sel_3 &amp; sel_2 &amp; sel_1 &amp; sel_0; <p> with adr select dOut&lt;= <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_0 when "000000", <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_1 when "000001", <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_2 when "000010", <BR>
dIn_3 when "000011", <BR>
dIn_4 when "000100", <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_5 when "000101", <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_6 when "000110", <BR>
dIn_7 when "000111", <BR>
dIn_8 when "001000", <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_9 when "001001", <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_10 when "001010", <BR>
dIn_11 when "001011", <BR>
dIn_12 when "001100", <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_13 when "001101", <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_14 when "001110", <BR>
dIn_15 when "001111", <BR>
dIn_16 when "010000", <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_17 when "010001", <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_18 when "010010", <BR>
dIn_19 when "010011", <BR>
dIn_20 when "010100", <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_21 when "010101", <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_22 when "010110", <BR>
dIn_23 when "010111", <BR>
dIn_24 when "011000", <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_25 when "011001", <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_26 when "011010", <BR>
dIn_27 when "011011", <BR>
dIn_28 when "011100", <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_29 when "011101", <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_30 when "011110", <BR>
dIn_31 when "011111", <BR>
dIn_32 when "100000", <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_33 when "100001", <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_34 when "100010", <BR>
dIn_35 when "100011", <BR>
dIn_36 when "100100", <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_37 when "100101", <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_38 when "100110", <BR>
dIn_39 when "100111", <BR>
dIn_40 when "101000", <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dIn_41 when
 
Depending on your design, you could put these in a BRAM and
then have the uP read the BRAM. Works well for reading back
values written to registers by the uP that you want to be
able to read back, in which case you have both your register
and the BRAM where the BRAM acts as a shadow register who's
sole purpose is to provide readback data to the uP. For
registers written by the FPGA, you can work the registers
like a shift register to write them into a BRAM, then have
the uP read the BRAM. It gains you random access without
the muxes and wires.

Gary Olson wrote:

Question I have is I need a 42X1 Mux
Actually I am muxing 42 16 bit databusses. The Timing is
critical
because the 42 16 bit words are read by a microcontroller.
I am wondering the best way to MUX theses signals. I could
use a 64X1 mux and syntesize out unused logic.

Or I could use a 32X1, 16X1 with a 2X1 to merge the two
muxed data paths.

Does it make any difference at all what I do? Any other
alternative approaches?

Thank You,
Gary Olson
--
--Ray Andraka, P.E.
President, the Andraka Consulting Group, Inc.
401/884-7930 Fax 401/884-7950
email ray@andraka.com
http://www.andraka.com

"They that give up essential liberty to obtain a little
temporary safety deserve neither liberty nor safety."
-Benjamin
Franklin, 1759
 

Welcome to EDABoard.com

Sponsor

Back
Top