Exponents in VHDL?

K

Kwaj

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

cheers
 
On Thu, 19 Aug 2004 20:32:55 +1000, "Kwaj"
<k.oteng@studentNOSPAM.unsw.edu.au> wrote:

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.
 
Hi,
U can implement the same by just pressing the * key 2 times ie.
2**3

I think it is helpfull 2 u .

Regards
 

Welcome to EDABoard.com

Sponsor

Back
Top