I need an Exponential function!!!

L

LeirbaG

I'm new in vhdl and i need urgent to find the way to implement an exponential function in my code. i'm totally desperated!!! i'm trying to implement an exponential function like e^x.
I'm trying to writte thiS:

--BABEL and ARMY are elements of an array of std_logic_vector(11 downto 0)
PROCESS (BABEL,ARMY)
VARIABLE A: integer range -100000000 to 100000000;
VARIABLE B: integer range -100000000 to 100000000;
VARIABLE ARMY1: integer range -100000000 to 100000000;
VARIABLE ARMY2: integer range -100000000 to 100000000;
VARIABLE BABEL1: integer range -100000000 to 100000000;
VARIABLE BABEL2: integer range -100000000 to 100000000;
VARIABLE e: REAL := 2.7182818284;

BEGIN
ARMY1:= CONV_INTEGER(ARMY(1));
ARMY2:= CONV_INTEGER(ARMY(2));
BABEL1:= CONV_INTEGER(BABEL(1));
BABEL2:= CONV_INTEGER(BABEL(2));
A := CONV_INTEGER(BABEL(1) - (BABEL(2)-BABEL(1))* CONV_STD_LOGIC_VECTOR(e**(ARMY2 - ARMY1),12));
B := CONV_INTEGER((BABEL(2) - BABEL(1))* CONV_STD_LOGIC_VECTOR((e**ARMY2 - e**ARMY1),12));
peak <= CONV_STD_LOGIC_VECTOR((A + B),12);

END PROCESS PEAK_CALCULATION;

the error is:
Error (10512): VHDL type mismatch at RISE_UP_DETECTOR.vhd(177): object(s) associated with operator ""**"" must have std_ulogic type

I really don't understand what this mean..please i need help!!!
i know my code is very archaic, but is all that i know....
what do i need? please if anyone can help me
(e-mail address removed)
 

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