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

format conversion

Altera_Forum
Honored Contributor II
1,150 Views

how to convert from std logic vector to integer? 

 

and  

 

how to convert from sfixed to std logic vector ?? 

 

:confused::confused::confused:
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
489 Views

Loads of good info here... 

 

www.synthworks.com/papers/vhdl_math_tricks_mapld_2003.pdf  

 

(Hope its OK to post links here, if not I will delete if requested :) 

 

Top tip.... 

 

Alwyas use the package  

 

use ieee.numeric_std.all 

 

for all new designs. 

 

For integer to std_logic_vector to you need to convert to unsigned (or signed) first 

 

signal A_slv : std_logic_vector (7 downto 0) ; 

signal Unsigned_int : integer range 0 to 255 ; 

 

Unsigned_int <= to_integer( unsigned( A_slv )); 

 

Good luck
0 Kudos
Altera_Forum
Honored Contributor II
489 Views

vernmid thanks alot for your help!!!!!!! rili thanks alot!!! i will try it out!!!

0 Kudos
Reply