A normaliser counts leading zeros and extracts the mantissa, so giving the logarithm to within 6dB. Typically you can then do table lookup on the top few bits of the normalised result, to get some more accuracy.
Obviously, it depends on the precision you need.
Standard methods such as Taylor series and CORDIC may also be useful if you want really high precision. Once again, it's MUCH easier if you normalise the number first, so that you only need to find the log of a number in the range 0.5 to 1.0 --
这是一位老外曾经回答的,因为要log,就要用浮点运算,其运算量是很大的。建议还是查表。 |