[Math] How to convert from 10s complement to base 10/decimal

arithmeticnumber-systems

I finally understood how to convert from base 10 to 10's complemnt here

But how do I convert back? How do I know what sign it is? In 2s complement, its the LSB, 1 means negetive else positive. For 10s complement?

If

$$-1122_{10} = 9999 – 1122 + 1 = 8878_{10s}$$

$$8878_{10s} = 9999 – 8878 – 1 = -1122_{10}$$

But why in another problem,

$$899_{10} – 7212_{10} = 00899_{10s} + 92788_{10s} = 93687_{10s}$$

$$93687_{10s} = 99999 – 93687 – 1 = -6311_{10}$$

Correct answer should be $-6313_{10}$. Probably my method of converting from 10s complement to decimal is wrong?

Hmm… I suspect its I should be doing $100000 – 93687$ … but why did it work in the 1st case? How do I determine the sign? LS"B" 9 means negative?

Best Answer

But how do I convert back?

In exactly the same way. Complements are involutions.

How do I know what sign it is?

Look at the leading digit. 0..4 => positive; 5..9 => negative.

Related Question