Multi-bit Multiplexer (Easy question)

D

Dan

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,
 
J

Jonathan Bromley

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
(e-mail address removed)
http://www.MYCOMPANY.com

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

How to design 4 bit 4:1 multiplexer 1
Generic Multiplexer 3
Generic multiplexer 1
Big multiplexer? 5
Issue with simulation time - Modelsim PE Student 10.4 1
32x1 MUX 1
SPI, I2C and CPLD 1
bit stuffing 5

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top