Theory works like this:

* Consider a number (say 15482) in decimal system

* This is equivalent to (1 * 10000) + (5 * 1000) + (4 * 100) + (8 * 10) + 2

* This is equivalent to (1 * 10^4) + (5 * 10^3) + (4 * 10^2) + (8 * 10^1) + (2 * 10^0)

where ^ is the power-of operator.

* Now consider a number (say 12F3B) in hexadecimal system

* Using similar logic, this is equivalent to (1 * 16^4) + (2 * 16^3) + (F * 16^2) + (3 * 16^1) + (B * 16^0)

Now all you have to do is compute 16^4, 16^3 etc. and also take F=15 and B=11 and there you have it... the answer in decimal

Note that you can use this logic to convert a number from *ANY* base into decimal.

## Thursday, March 19, 2009

Subscribe to:
Post Comments (Atom)

## No comments:

Post a Comment