Algorithm for converting other bases to decimal



Algorithms for Number Conversions

Algorithm for converting other bases to decimal (Multiplication Rule)

1. Multiply the right most digit with the base raised to the power of 0.

2. Multiply the next left digit with the base raised to the power of 1

3. Continue multiplying the digits to the left with the base in the order of increasing powers.

4. Add the answers of the above steps to get the final answer.

Algorithm for converting decimal to other bases (Division Rule)

1. While (the quotient is not zero)

2. Divide the decimal number by the new base

3. Make the remainder the next digit to the left in the answer

4. Replace the original decimal number with the quotient

Algorithm for converting binary to Hexadecimal (Group by Four)

1. Make groups of four (from right)

2. Convert each group to equivalent value of hexadecimal (use number chart)

Algorithm for converting binary to Octal (Group by three)

1. Make groups of three(from right)

2. Convert each group to equivalent value of hexadecimal

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download