3.1.2. Number System Conversion

3.1.2.1. Decimal To Non-Decimal

To convert a number system from decimal to non-decimal, we need to use math operations: modulo and division.

tinyurl_algo

3.1.2.2. Non-Decimal To Decimal

To convert a number system from non-decimal to decimal, we need to use one new math operations: exponent.

../_images/sloth.jpg

Figure 3.1.1 Sloth likes 8-based octal.

In the following graph, we convert from binary to octal. Because our computation operations like +, -, * and / are all assuming decimal numbers, we can first convert it to decimal, and then convert from decimal to octal.