[Open-graphics] Other interesting bits of math to do in FPGAs
Hamish
hamish at travellingkiwi.com
Wed Sep 19 10:56:40 EDT 2007
On Wednesday 19 September 2007 14:20, Timothy Normand Miller wrote:
> We've talked a lot about multipliers recently, and in the past, we've
> talked about floating point adders, multipliers, and reciprocal.
>
> Another interesting function that might be good to implement is the
> logarithm. In fact, I think we may actually need that to do
> MIP-mapped textures.
>
> But there are more general applications. I've studied various
> problems in AI where numberous probabilities must be multiplied
> together, for instance in hidden markov models. (HMMs). To avoid
> having to multiply smaller and smaller numbers, people commonly switch
> to log space. Instead of multiplying small positive numbers, you add
> large negative numbers. Logs of probabilities are commonly referred
> to as "likelihoods" or "log likelihoods." I don't remember enough
> about the math to explain the advantage, but apparently, there is one.
Am I too old? Adding logs instead of multiplying (And subtracting instead of
dividing) was how I learnt to do multiplication adn division before you werte
allowed to use calculators in school exams (Early 1980's in NZ :)
In the mid-late 80's we also used methods like this for steam calculations
(Water table calculations were quite unweildy things to work with in those
days. I wonder whether they still use tables or calculate that nowadays).
Didn't some early processors (e..g Pentium floating point bug) use a similiar
method for multiplication and division by keeping what was essentially a log
table in ROM and the microcode would lookup a log, add/subtract & convert
back instead of trying to do multiplication/division longhand?
Come to think of it, would it be more efficient (Thinking of time & logic vs
table lookup space) to use a lookup table to caluclate log/alog like using
Eton tables in the old days? Or actually calculating it?
Hamish.
More information about the Open-graphics
mailing list