Forum Discussion
Altera_Forum
Honored Contributor
15 years agoFloat to Fixed Point in FPGA
Hi there.
I have DSP code in C with floating point, now I try to convert to FPGA to use fixed point. Can you guys show me how to do it? I did little research document from http://www.vhdl.org/fphdl/ with fixed_pkg_c.vhdl. But I don't know how to start. example in C: i_sample = 0.7071; q_sample = 0.2487; How do I take this floating point to convert to fixed point or hex value? Thank you guys, Sean11 Replies
- Altera_Forum
Honored Contributor
You could use this javascript form I created
http://davidcastells.blogspot.com.es/2012/07/floating-point-to-fixed-point-online.html ...and use the binary value if you are using 16 bits for integer part, and 16 bits for the decimal 0.7071 becomes "00000000000000001011010100000100" and 0.2487 becomes "00000000000000000011111110101010" you can play with other bit width representations