Hi to all,
I have a problem with Quartus II (Altera),that depends on my poor knowledge of vhdl.
This code:
Code:
[…]
type lut_array_type is array(3 downto 0) of std_logic_vector(5 downto 0);
signal myLUT : lut_array_type ;
[...]
myLUT(0)<="10011";
myLUT(1)<="11011";
myLUT(2)<="10010";
myLUT(3)<="10101";
[…]
result <= (2**myLUT(0));
I have an error on last row; "... can't determine definition of operator ""**"" -- found 0 possible definitions"
Why? Can you help me?
What makes you think that ** operator is defined for integer ** std_logic_vector?
For a complete question, you need to specify the imported libraries and definition of result.
As far as I'm aware of, ** isn't synthesizable, power of two can be however represented by SHL operator, with argument types supported by the respective libraries.
Quartus will tell you that it's not synthesizable. You can implement it as repeated multiply, of course only useful for small exponents or in a pipelined design.
What do yo want to achieve? Under circumstances, it's better to use a precalculated table of powers.