1
$\begingroup$

Can somebody explain in simple terms how addition works in a logarithmic number system. Say I have the numbers A and B. These are logarithms (base e, say) of the actual quantities they represent. They both represent positive quantities, there is no sign bit. Without any of the extra terminology I don't need now and can figure out myself later, how do I add A and B?

Thanks in advance!

Edit: Here are some links to other sites which explain the common method of adding numbers in a Logarithmic Number System. Maybe you could just explain what is here: http://semipublic.comp-arch.net/wiki/Logarithmic_number_system_%28LNS%29

http://en.wikipedia.org/wiki/Logarithmic_number_system

2 Answers 2

1

If $A=\log r$ and $B=\log s$, and if what you want is the number representing $r+s$, then you go $r=e^A$, $s=e^B$, $r+s=e^A+e^B$, $\log(r+s)=\log(e^A+e^B)$, and there's your answer: $\log(e^A+e^B)$.

EDIT: At the Wikipedia link, it says $\log(X+Y)=\log X+\log(1+b^{\log Y-\log X})$ where $b$ is the base of the logarithms. Switching to the letters I used above, this says the number representing $r+s$ is $A+\log(1+b^{B-A})$ Now that's mathematically equivalent to the answer I gave (as Robert indicates): $\log(b^A+b^B)=\log(b^A(1+b^{B-A}))=\log b^A+\log(1+b^{B-A})=A+\log(1+b^{B-A})$ I suppose it's cheaper because my answer requires two exponentiations and a logarithm while this answer needs only one exponentiation and a logarithm (although it needs more additions/subtractions than the earlier answer).

  • 0
    Yes, after that edit your answer matches what I see on Wikipedia. If you look at Robert's answer he has it slightly wrong.2012-10-15
1

If $A = \log a$ and $B = \log b$, $\log(a + b) = \log(e^A + e^B)$. You could write this as $A + \log(1 + e^{B-A})$ or as $B + \log(1 + e^{A-B})$, but there's really nothing simpler.

  • 0
    No, see I think you have this wrong. log(a+b)=log(e^A + e^B)=A+log(1 + e^(B-A)) big A, not little A2012-10-15