Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
21615 Discussions

sfixed to standard logic vector

Altera_Forum
Honored Contributor II
1,499 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
620 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
620 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