Base Conversion between Numbering Systems

4

I am studying Computational Mathematics, more specifically Numbering Systems and their conversion.

Numeration Systems are widely used in programming and computing in general, so my study focused more on the four essential types used in computing:

  • Decimal system N = {0,1,2,3,4,5,6,7,8,9}
  • Binary system N = {0,1}
  • octal system N = {0,1,2,3,4,5,6,7}
  • Hexadecimal system N = {0,1,2,3,4,5,6,7,8,9, A, B, C, D, E, F}

    Is my question limited to how to do basic conversion faster and more effectively?

    Is there a method or methodology to perform basic conversion faster and more effectively?

    Knowing that to convert a number from one base to another requires a large calculation and specific rules.

    Conversão de Hexadecimal para Decimal
    
    A regra é a mesma da conversão de qualquer sistema de numeração para o decimal.
    
      

    AFC0.7D =?

         

    Ax16³ + Fx16² + Cx16¹ + 0x16 ° + 7x16-¹ + Dx16-²

         

    10x16³ + 15x16² + 12x16¹ + 0x16 ° + 7x16-¹ + 13x16-²

         

    44992,4882810

    Note that the hexadecimal system shown above is positional starting from right to left, so the base is raised to (16¹, 16 °, 16-¹) and you also notice that each digit was multiplied by 16 because the hexadecimal numbering is composed of base equal to 16. Therefore 16 different digits.

        
  • asked by anonymous 03.05.2017 / 18:11

    1 answer

    3

    The simplest conversions are those involving bases that are powers to each other.

    Example: conversion between base 2 and base 8. As 2 3 = 8 we separate the figures from the binary (base 2) into groups of three (power of 2 -> 3 ) digits (always starting from right to left). 11101001=011.101.001

    Binary direct conversion table for octal and vice versa.

    binário  |  octal
     000     |     0
     001     |     1
     010     |     2
     011     |     3
     100     |     4
     101     |     5
     110     |     6
     111     |     7
    

    So,

    011 on base 2 = 3 on base 8

    101 on base 2 = 5 on base 8

    001 on base 2 = 1 on base 8

      

    therefore 11101001 2 = 351 8

    Conversion between bases 2 and 16. As 2 4 = 16, following the previous process, we only have to divide into four-digit groups (power of 2 -> 4 ) and convert each group following a table similar to the previous one.

    Example 11110101101 = 0111. 1010. 1101

    Binary direct conversion table to hexadecimal and vice versa

     binário  |  Hexadecimal
     0000     |     0
     0001     |     1
     0010     |     2
     0011     |     3
     0100     |     4
     0101     |     5
     0110     |     6
     0111     |     7
     1000     |     8
     1000     |     9
     1010     |     A
     1011     |     B
     1100     |     C
     1101     |     D
     1110     |     E
     1111     |     F
    

    0111 = 7, 1010 = A, 1101 = D

      

    Therefore

    For other conversions, use the general expression you used.

        
    03.05.2017 / 19:23