Multi-bit Multiplexer (Easy question)

D

Dan

Guest
Hi,

I'm designing a multi-bit multiplexer. It's a 8-to-1 Multiplexer, each entry
is 8-bit long and the output is 8-bit long, too. The problem is that I don't
know how to create an entity to express this. Maybe I need to create a
matrix type (8x8) and use it in the entity? Could you provide an example? I
don't want to use packages.

Thanks in advance,
 
On Sat, 3 Nov 2007 19:29:30 +0100, "Dan" <nomail@noserver.com> wrote:

I'm designing a multi-bit multiplexer. It's a 8-to-1 Multiplexer, each entry
is 8-bit long and the output is 8-bit long, too. The problem is that I don't
know how to create an entity to express this. Maybe I need to create a
matrix type (8x8) and use it in the entity? Could you provide an example? I
don't want to use packages.
But surely you *must* use packages if you want to create an 8-element
array of 8-bit vectors as a port, because that's the only way to
make a new data type available on an entity's port.

library ieee; use ieee.std_logic_1164.all;
package byte_pkg is
subtype byte is std_logic_vector(7 downto 0);
type byte_array_t is array(natural range <>) of byte;
end;

library ieee; use ieee.std_logic_1164.all;
use work.byte_pkg.all;
entity 8x8mux is
port(
A_0_7 : in byte_array_t(0 to 7);
selector: in std_logic_vector(2 downto 0);
Y : out byte
);
end;

Other approaches might be :
1) create 8 distinct 8-bit input ports (might be easier)
2) provide a 64-bit input port and connect each of the
eight 8-bit inputs to a slice of it

hth
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
jonathan.bromley@MYCOMPANY.com
http://www.MYCOMPANY.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
 

Welcome to EDABoard.com

Sponsor

Back
Top