Forum Discussion
Altera_Forum
Honored Contributor
15 years agoFixed point math functions
Hello, I know that fixed point logic circuits are similar to integers. But my question is. Say I convert a 15bit integer (A) to fixed point <15bits.10bits> by just using {A[14:0],10'b...
Altera_Forum
Honored Contributor
15 years agoYou will have to do all of the hard work yourself.
If you want to add or subtract, you first have to pad extra zeroes before performing the operationfp_4_3 := (fp_4_1 & "00") + (fp_2_3) For multiplication and devision, you don't need to adjust the factors. You just need to figure out where the fraction in the result is: fp_5_3 := fp_2_2 * fp_3_1 There is a VHDL 2008 package that does all of that for you. It is called FIX_STD. Just google it.