I want use power in my code in VHDL :
for example A * (10**b) that b > 2 but I have this error in Quartu 6.1
Error (10638): VHDL exponentiation error at project_2.vhd(20): operator not supported for the specified operands, base must be a positive power of 2 with non-constant exponent.
any one here for help that what can i do ?
Thanks
Yes. You cant synthesise the ** operator where the base is not a power of 2. I suggest redesigning the algorithm with some form of multiplier chain, or changing the 10**factor for some 2**c factor.
2**c is just a bitshift operation, and very simple.
What is the range of b? how many values can it take? if it isnt very many (say, < 32), you can do this simply with a mux, otherwise I recommend using a look-up table.
2**c will work, because the answer will always be a 1 with a load of '0's around it - very cheap to implement. any other wont work because the answer cannot easily be determined.