Leader

Base conversion of positional number systems

The decimal system is the most commonly used symbolic number system in the world. It uses numbers (0-9) to represent any possible value by varying the position of individual digits. The reason for using a base of 10 is surprisingly obvious; ever wondered why fingers are also known as digits?

Other positional number systems exist, such as binary, which work along the same positional principle, just with a different base. For example, binary has a base of 2, because computer bits can be one of two values; 0 or 1. Hexadecimal uses a base of 16, which means it needs to borrow letters to represent its numerals above 10.

Apart from the slight complication of sometimes having to interpret new symbols, different number systems are fairly easy to convert between. In each system, the general rule for determining value of a positional number system is total value = sum of each digit * the base ^ the digits position. For example, 543 in decimal...

543 = (5*10^2) + (4*10^1) + (4*10^0).


Matlab includes some functions for converting between different bases. Here are alternative versions of these functions and introductions to each system and the conversion processes:





No comments:

AdSense