Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > I need an Exponential function!!!

Reply
Thread Tools

I need an Exponential function!!!

 
 
LeirbaG
Guest
Posts: n/a
 
      12-20-2007
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
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
converting exponential number to float number ruds Java 3 01-10-2007 10:15 PM
unusual exponential formatting puzzle Neal Becker Python 5 09-22-2005 01:14 PM
Exponential diegoandrade@gmail.com C++ 1 02-11-2005 03:18 AM
Exponential Notation and integers Timothy Fitz Python 4 11-19-2004 02:28 AM
Re: See data in exponential format Eric Lawrence [MSFT] ASP .Net 3 03-02-2004 10:26 AM



Advertisments