how to calculate the exponential of signed fixed number

Status
Not open for further replies.

elhady

Newbie level 1
Joined
Apr 25, 2010
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,295
i want to calculate the exponential of signed fixed number, but i know that the fixed point library doesn't support this function. so i tried to convert the fixed number to real number first to use the exponential function in math_real package, and i used the command
to_real(),

but i got the message
"non-constant real valued expression isn't supported".

also i used the following packages :

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
USE IEEE.Numeric_STD.ALL;
use ieee.math_real.all;

--library ieee_2008;
--use ieee_2008.math_real.all;

library ieee_proposed;
use ieee_proposed.fixed_pkg.all;
use ieee_proposed.fixed_float_types.all;
--use ieee_proposed.float_pkg.all;


and try many combination but every time i got different error.

so can i get a solution to get the exponential of fixed point number
 
Last edited by a moderator:

You are apparently trying to use real numbers in synthesized hardware logic. That's not possible, real type can be only used in simulation and compile time calculation (e.g. of constant expressions) in synthesis. You'll either use floating point numbers or make your own fixed point exp() function, e.g. based on look-up tables.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…