Forum Discussion
Altera_Forum
Honored Contributor
9 years ago1. This is a mix up between two things. You have a mix of subtype syntax and type syntax. A type will declare a brand new type, like an array type, or enumerated type. (0 to 15) would be used when declaring an array or an array type:
eg: type my_array_t is array(0 to 10) of integer; signal sig : std_logic_vector(7 downto 0); What it look like you are trying to do, is declare a subtype, as you are limiting the range of an existing type: subtype rang0to15 is natural range 0 to 15; -- no () needed 2. I dont quite know what this is - but it is not legal. And I dont know what the Table_Nbres type is. You also cannot declare a range as a type. Did you mean: Q7Seg <= Table_Nbres(0 to 15); This is also broken, because rang0to15 is not legal. You could write: type tBCD7Seg is array (rang0to15'low to rang0to15'high) of std_logic_vector(7 downto 0);, but it would be more sensible to write type tBCD7Seg is array (0 to 15) of std_logic_vector(7 downto 0);