Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21587 Discussions

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

Altera_Forum
Honored Contributor II
1,226 Views

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
0 Kudos
0 Replies
Reply