|
Number Systems - ConversionsBaseN to DecimalAll number systems going from BaseN to Decimal can be done using the following approach. Take every character in the current base and multiply it by the radix (N) to the power of the position. Next convert each character to its decimal equivalent. Add up all of these terms to get the decimal value of the number. Example: Binary to Decimal 10010011Base2 Example: Hexadecimal to Decimal 1ADBase16 Decimal to BaseNAll number systems going from Decimal to BaseN can be done using either of the following approaches. Formal ApproachTake the decimal and divide by the new radix (N). The remainder of this division is the least significant digit in the new radix. Treat the quotient of the division as the new number and repeat the process. This remainder will be the next least significant digit. Example: Decimal to Binary 1073/2 = 536 RTherefore 1073Base10 = 100 0011 0001Base2 Alternate ApproachPrecompute successive powers of the radix until you have a number greater than the number you are trying to convert. Subtract the largest power from your starting number without producing a negative result. Record a Example: Decimal to Binary 1073 - 1024 = 49 (result so far =Therefore 1073Base10 = 100 0011 0001Base2 Last Modified: |