Multi-bit Multiplexer (Easy question)

Discussion in 'VHDL' started by Dan, Nov 3, 2007.

  1. Dan

    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,
    Dan, Nov 3, 2007
    #1
    1. Advertising

  2. On Sat, 3 Nov 2007 19:29:30 +0100, "Dan" <> 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

    http://www.MYCOMPANY.com

    The contents of this message may contain personal views which
    are not the views of Doulos Ltd., unless specifically stated.
    Jonathan Bromley, Nov 3, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lily
    Replies:
    6
    Views:
    4,673
    Eric Smith
    Apr 29, 2004
  2. bxbxb3

    Big multiplexer?

    bxbxb3, Apr 15, 2005, in forum: VHDL
    Replies:
    5
    Views:
    760
    bxbxb3
    Apr 19, 2005
  3. woko

    Multiplexer Index

    woko, Aug 3, 2005, in forum: VHDL
    Replies:
    2
    Views:
    536
  4. Weng Tianxiang
    Replies:
    12
    Views:
    1,590
  5. Faisal Kabir

    How to design 4 bit 4:1 multiplexer

    Faisal Kabir, Oct 6, 2013, in forum: VHDL
    Replies:
    1
    Views:
    278
    Jim Lewis
    Oct 8, 2013
Loading...

Share This Page