Mombu the Programming Forum sponsored links

Go Back   Mombu the Programming Forum > Programming > 2 powerof (x) - where x fixed point value
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 4th June 13:28
david bishop
External User
 
Posts: 1
Default 2 powerof (x) - where x fixed point value



Go to:
http://www.vhdl.org/vhdl-200x/vhdl-200x-ft/packages/
you will need
math_utility_pkg.vhdl
fixed_pkg_c.vhdl

Then you can say:

use ieee_proposed.fixed_pkg.all;
....
signal xfixed : sfixed (3 downto -3);
signal xpower : integer;

xfixed <= to_sfixed (1.5, 3, -3);

xpower <= find_msb (abs(xfixed));

All synthesizable, and it should give you what you want.
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666