Exponents in VHDL?

A

Allan Herriman

How do we do implement the exponent function "6" in VHDL, i.e. as in 2^3=8.

I assume you missed the shift key and actually meant "^" instead of
"6".

The VHDL operator for exponentiation is **, e.g. x**y

Many other languages use the same symbol, e.g. Verilog, Fortran, etc.

All simulators will support it.

Synthesisers will probably support it for any values of x and y if x
and y are both constant, but probably not support it if x isn't a
constant. If x is a constant and also a power of 2 (e.g. 2 or 4,
etc.) then most synthesisers will support variable y.

Regards,
Allan.
 
A

anupam

Hi,
U can implement the same by just pressing the * key 2 times ie.
2**3

I think it is helpfull 2 u .

Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top