Quantcast
Channel: Altera Forums
Viewing all articles
Browse latest Browse all 19390

declaring port as array type

$
0
0
How to solve a problem with declaring port as array type?
I want to make entity multiplexer like this:

Code:

entity multiplexer is
    generic(
        sel_bits: integer := 2;
        data_width: integer := 1
    );
    port(       
        input: in array (2**sel_bits-1 downto 0) of bit_vector(data_width-1 downto 0);    -- this won't do. I could use package, but is there this kind of solution?
        output: out bit_vector(data_width-1 downto 0);       
        sel: in bit_vector (sel_bits-1 downto 0)
    );
end entity multiplexer;


Viewing all articles
Browse latest Browse all 19390

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>