Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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).

share|improve this answer
    
This is the only way that makes sense to me, as the obvious solution, but it is more expensive than the method generally used in a Logarithmic Number System. I was hoping that somebody could explain the other, more complicated method. –  Big Endian Oct 15 '12 at 4:58
    
Yes, after that edit your answer matches what I see on Wikipedia. If you look at Robert's answer he has it slightly wrong. –  Big Endian Oct 15 '12 at 18:06

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.

share|improve this answer
    
I will clarify my question, this doesn't explain what I'm seeing on other sites. –  Big Endian Oct 15 '12 at 5:02
    
Do you see how what is on Wikipedia is different than what you got with your algebraic manipulation? The problem is that Wikipedia is using some nested functions and there are subscripts all over, the intent of the author isn't particularly clear. –  Big Endian Oct 15 '12 at 5:07
    
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 A –  Big Endian Oct 15 '12 at 5:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.