Sereena
Sereena

Reputation: 37

Exponential function for synthesizable code

I'm trying to write a fitness function that is used in a genetic algorithm, and this function contains an exponential part.

How can I implement this function (e^x) where e is the base=2.7 and x is the exponent in the Verilog HDL language as synthesizable code?

Upvotes: 2

Views: 11303

Answers (1)

Morgan
Morgan

Reputation: 20514

In Verilog ** is the exponential function i.e e**x.

You could create a time shared version easily if the exponent is integer, just multiply the base by itself x times, taking x-1 clock cycles.

Upvotes: 5

Related Questions