There are several problems in the code:
- You pass the result of your calculation to
unsigned, and the left side -std_logic_vector - There may be something wrong with the data type
addr, but you have not shared this with us. - There is no closing parenthese in the assignment.
This will be easier if you use "unsigned" in your type definitions. This way you express that the bit pattern is what you want to use in integer arithmetic.
type offsets_type is array (4 downto 0) of unsigned (4 downto 0);
signal av : offsets_type;
signal addr :unsigned(2 downto 0);
This will save several type conversions:
av(to_integer(addr)) <= av(to_integer(addr)) + "1";
Edit: you used ieee.numeric_std.all, right?
source
share