Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

CCannot continue because of fatal error (sfixed to floating point)

Hi all;

It is possible if I want to convert from sfixed to floating point? For example: convert 000001000 to 0.483..

I try to write like below, but its working for convert integer..

-------------------------------------------------------

library ieee;

library ieee_proposed;

use ieee_proposed.fixed_pkg.all;

use IEEE.STD_LOGIC_SIGNED.ALL;

use IEEE.numeric_std.all;

entity try is

port (A: in sfixed(4 downto -4);

clk: in bit;

out_A: out integer range -127 to 127);

end try;

architecture try of try is

begin

process (clk)

begin

if (clk'event and clk='1') then

out_A <= to_integer(signed(A));

end if;

end process;

end try;

-----------------------------------------------------------

There are no problems when I compile in quartus. But, a fatal error occur when I simulate in ModelSim. Need helps..Thanks
No RepliesBe the first to reply