Forum Discussion
Altera_Forum
Honored Contributor
10 years agoTricky:
That sounds like a good idea, and yes I found that avoiding to floating-point logic saves a lot of space. There are other good and bad parts using floating-point, for example, if the 0.0003~ coefficient is used, floating holds the accuracy, however, if there's its counterpart which is 1.0 - 0.0003~, the result is 0.9997, which floating-point loses ~12-bit accuracy, which is why I prefer the 36-bit fixed rather than using a 32-bit float. I have been looking at the '93 compatible version vhdl files, and I see there's a lot of homework to find all the information. The first thing I noticed that may halt my progress is......
package float_pkg is
-- generic (
-- Defaults for sizing routines, when you do a "to_float" this will be
-- the default size. Example float32 would be 8 and 23 (8 downto -23)
constant float_exponent_width : NATURAL := 8;
constant float_fraction_width : NATURAL := 23;
...
...the 24-bit accuracy as defined. I see the value can be adjusted, bit I'm not sure are any limits internally. I usually have my own width for accuracy so I can test compilation with 16 or 18-bit width many times until it works, then increase it to the 36-bit width for the last build, it's takes way longer. Before I was looking at the '93 compatible version, I was considering making my own real to signed/unsigned for the coefficient conversion for constants. That's lots of binary compare/divide/subtract loops. The send double formatted bytes over rs232 sounds more complicated, but if I have accurate 36-bit (or larger if required) I can easily send the signed/unsigned bytes after that conversion. Any suggestions? David K.