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

sfixed to standard logic vector

Altera_Forum
Honored Contributor II
1,490 Views

is it possible to have sfixed converted to standard logic vector? if yes..how?? 

 

i need to use sfixed because the input data are all fractional real number. and the input need to be map to the rom to retrieve its appropriate output. but the address of the rom hav to be in standard logic vector, am i right? so i need to convert the sfixed to standard logic vector.
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
611 Views

Sounds like your using IEEE.fixed_pkg. It has a conversion function to_slv alias to_StdLogicVector.

0 Kudos
Altera_Forum
Honored Contributor II
611 Views

yeah im using IEEE.fixed_pkg so is the following correct??  

 

 

signal out: sfixed(3 downto -12); 

signal outS : std_logic_vector (15 downto 0);  

 

out <= obtain_Yn_real(1); 

outS <= to_StdLogicVector(out, 16);
0 Kudos
Reply