I am writing an FIR filter in VHDL and i tested with some random coefficients like 1,2,3,4,5 and it works fine for impulse response.
Now I have to test it with some actual coefficients which are like
-0.00000001234
or
0.0000234569
I was wondering that if some one can tell me how to convert this into std_logic_vectors or if i can some how use them as it like some integer conversion
Multiply all your floating point values by one large constant, round them off to integers, and feed them into your VHDL table. Now you can implement your FIR using integer arithmetic.
Don't make that constant too big, or your integer arithmetic will overflow. Don't make it too small, or the roundoff error will be greater than necessary.
Sounds like you need to learn how to do fixed point arithmetic. Try searching the web for those three words, and you will get a lot of hits. Maybe someone here can suggest a good book or tutorial site.
Re: How to use floating point coefficients in an FIR using V
Yes, There is no concept of Floating Point in VHDL. We have to keep in our mind by a cautinary declaration of Floating Points For eg. for 32-Bit Floating Point No.
From Left Hand Side:
31 30---------------23 22-----------------------0
Sign Exponent Significand
And the Floating Point is assumed but is not there in VHDL
For more info on this refer to Computer Architecture Book by Hennesy & Patterson