Friday, September 26, 2014

Conversion from decimal to octal


We can now discuss the conversion from decimal to octal base. It comes about in two stages: We convert first the number to "nonal" base and then the nonal number to octal. The conversion to nonal is achieved taking the digits of the decimal number one by one from the end to the beginning and adding them, multiplying several times with the coefficients of the Pascal triangle and paying special attention to carry-overs. The conversion to octal is achieved by applying the same process to the nonal number, using the same coefficients.

Example: 77 (10) = 7 7+7 (9) = 7 14 (9) = 85 (9)
85 (9) = 8 13 (8) = 8 + 1 5 (8) = 115 (8)

Notice that the sum of the single digits of the number after conversion to octal is 1 + 1 + 5 = 7, showing that the decimal number (77) was divisible by 7. This is another test for divisibility by 7. 

Another example: 11111 (10) = 1111 1+1 (9) = 1111 2 (9) = 111 2*1 +1 2 + 1 (9) = 11133 (9) = 11 3*1 + 1 3 * 1 + 3 1*1 + 3 (9) =
11 4 6 4 (9) = 1 4*1 + 1 6*1 + 4 4*1 + 6 1*1 + 4 (9) = 1 5 10 10 5 (9) = 16215 (9)

16215 (9) = 1621 1*1 + 5 (8) = 1621 6 (8) = 162 2*2 + 1 2*1 + 6 (8) = 162 5 8 (8) = 16 6*3 + 2 6 * 3 + 5 6 * 1 + 8 (8) = 16 20 23 14 (8) = 1 4*1 + 6 6*1 + 20 4*1 + 23 1*1 + 14 (8) = 1 10 26 27 15 (8) = 1 10 26 28 7 (8) = 1 10 29 4 7 (8) = 1 13 5 4 7 (8) = 25547 (8)

Notice that adding the digits of the octal number one by one we have , after casting out sevens: 2 + 5 = 7 = 0 5 + 4 = 9 = 2 7=0. We have shown thus that decimal 11111 has a remainder of two when divided by 7.

No comments: