Forum Discussion
Altera_Forum
Honored Contributor
16 years agoMay be this is not the answer you are after but I post this just in case..
In hardware few people need to use any number system apart from 2's complement or other fixed-point(limited bitwidth). Software engineers have the convenience of using the wide resource demanding float. In hardware fractional 2's complement is possible but I normally use integer 2's complement to represent fractions. An example will illustrate this: A filter has coeffs(1, .9532 .0567...etc) to be represented on 16 bits signed, you scale up in hardware to say (16384, 15617, 929 ...etc)then you multiply by input stages and divide back(truncate 14 bits = divide by 16384) so you get the effect of 1, .9532,.0567 on the input. similarly you want a gain of .000133: you multiply your input by .000133 * 2^20/2^20 i.e. multiply by 139 then truncate 20 bits off yielding .000133 effect.