Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

VHDL error power of 2 in quartus

Status
Not open for further replies.

Adnan86

Full Member level 2
Full Member level 2
Joined
Apr 4, 2013
Messages
121
Helped
26
Reputation
52
Reaction score
26
Trophy points
1,308
Visit site
Activity points
2,153
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.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top