Conversion between number bases (Decimal, Binary, Octal, Hexadecimal) with details. Different based numbers have different conversion rules. 

Conversion between number bases means converting one base to another. 

Some Conversion between number bases like from decimal to other bases, other bases to the decimal base, binary to octal and hexadecimal, octal, and hexadecimal to binary, Octal to hexadecimal and hexadecimal to octal.

 
Conversion between number bases

Table for conversion


A 3-bit string can have 8 permutations at most. 
It can be said that from here a single octal digit can represent each 3-bit string uniquely. 

Similarly,


A 4-bit string can have 16 permutations at most. 

It can be said that from here a single hexadecimal digit can represent each 3-bit string uniquely.   

The table below representing


  • The decimal numbers 0 to 15
  • Binary numbers of the decimal numbers 0 to 15 
  • Octal numbers of the decimal numbers 0 to 15 
  • Hexadecimal numbers of the decimal numbers 0 to 15 
  • 3-bit strings 
  • 4-bit strings


Table for Conversion
Decimal
(10)
Binary
(2)
Octal
(8)
String(3 bit)
Hexadecimal
(16)
String(4 bit)
0
0
0
000
0
0000
1
1
1
001
1
0001
2
10
2
010
2
0010
3
11
3
011
3
0011
4
100
4
100
4
0100
5
101
5
101
5
0101
6
110
6
110
6
0110
7
111
7
111
7
0111
8
1000
10

8
1000
9
1001
11

9
1001
10
1010
12

A
1010
11
1011
13

B
1011
12
1100
14

C
1100
13
1101
15

D
1101
14
1110
16

E
1110
15
1111
17

F
1111



Other number systems to decimal number system rule

Other number systems to decimal number system
  • Binary number system to decimal number system
  • Octal number system to decimal number system
  • Hexadecimal number system to decimal number system

For converting other based numbers such as binary(base=2),octal(base=8),hexadecimal(base=16) to a decimal(base=10)  number system we have to follow some rules.  

Other number systems to decimal number system rule
Steps:


  1. Determine the column (positional) value of each digit.
  2. Multiply the obtained column values by the digits in the corresponding columns.
  3. Calculate the sum of these products.

Binary number system to decimal number system

To convert a Binary number system to a decimal number system we have to multiply each bit by 2ⁿ and add all finally. Here n is the position of the bit. 

Example

Problem: (10101.001)₂ = (?)₁₀

Solution: 

Here,

4  3  2  1  0  -1  -2 -3

↑  ↑  ↑  ↑  ↑   ↑   ↑  ↑

1  0  1  0  1   0   0  1

So,
(10101.001)₂ 

=1✕2⁴+0✕2³+1✕2²+0✕2¹+1✕2⁰+0✕2⁻¹+0✕2⁻²+1✕2⁻³

= 16+0+4+0+1+0+0+0.125

= (21.125)₁₀

(ANSWER)

Octal number system to decimal number system

Octal number system to decimal number system

To convert the Octal number system to a decimal number system we need to follow some rules. In this case, we have to write the position number of each octal digit. 

At the left part of the point, we have to give zero at the most right digit.

 As like this, we have to give positions such as 1,2,3,4....n(n=
most left).  

And the right part of the point we have to give -1 at the most left digit. As like this, we have to give positions such as -2,-3,-4....-m(m=
most right). 

Then we have to multiply each digit by 8(base of octal) to the power of position.

Example

Problem:(73021.475)₈  =  (?)₁₀
Solution:

Here,


4  3  2  1  0 -1  -2 -3


↑  ↑  ↑  ↑  ↑  ↑   ↑   ↑


7  3  0  2  1  4   7   5



So, 

(73021.475)₈  

= 7✕8⁴+3✕8³+0✕8²+2✕8¹+1✕8⁰+4✕8⁻¹+7✕8⁻²+5✕8⁻³

=  (30225.61914)₁₀
(ANSWER)

Hexadecimal number system to decimal number system

Hexadecimal number system to decimal number system

To convert the Hexadecimal number system to a decimal number system we have to follow these rules.
Hexadecimal number system the base = 16.
In this case, we have to write the position number of each hexadecimal digit. At the left part of the point, we have to give zero at the most right digit.

 As like this, we have to give positions such as 1,2,3,4....n
( n = most left).  

And the right part of the point we have to give -1 at the most left digit. As like this, we have to give positions such as -2,-3,-4....-m
(m =most right). 

Then we have to multiply each digit by 16(base of hexadecimal) to the power of position.

Example

Problem:(A1074.C05)₁₆=(?)₁₀

Solution:
Here,

4  3  2  1  0  -1   -2  -3
↑  ↑  ↑  ↑  ↑   ↑    ↑    ↑

A 1  0  7  4   C    0   5

So,

(A1074.C05)₁₆

= A✕16⁴+1✕16³+0✕16²+7✕16¹+4✕16⁰+C✕16⁻¹+0✕16⁻²+5✕16⁻³

= 10✕16⁴+1✕16³+7✕161+4✕16⁰+12✕16⁻¹+5✕16⁻³

= (659572.7512)₁₀


(ANSWER)



Decimal number system  to other number systems conversion rule

Decimal to other number systems


Decimal number system to binary number system

Decimal number system to octal number system
Decimal number system to hexadecimal number system

    Decimal number system  to other number systems conversion rule

    If the given number is a decimal number(Base=10) then for converting it into other number systems we have to follow these.

    For Non-fractional numbers



    First step: Divide the decimal number to be converted by the value of the new base.

    Second step: Then record the reminder from the first step as the rightmost digit (least significant digit).

    Third step: Divide the quotient of the previous divide by the new base.

    Fourth step: Record the remainder from Step 3 as the next digit (to the left) of the new base number.

    Repeat Steps 3 and 4, recording remainders from right to left, until the quotient becomes zero in Step 3.
    Note that the last reminder thus obtained will be the most significant digit (MSD) of the new base number.


    For fractional numbers



    If we found fractional numbers in the result then we have to take the fractional part of that multiplication result and again have to multiply by the value of the new base.



    Else (All are zero after a fractional point) then we have to stop multiplying.



    Finally, we have to write all the integer part of all multiplication results from top to bottom.


    Overall we can say the rules are given below in short-





    Decimal to



    Binary(2)




    Octal(8)



    Hexadecimal(16)

    By binary base 2-

    Divide the left part of the decimal point and multiply the right part of the decimal point of the given decimal number.

    By octal base

    8-

    Divide the left part of the decimal point and multiply the right part of the decimal point of the given decimal number.



    By hexadecimal base 16-

    Divide the left part of the decimal point and multiply the right part of the decimal point of the given decimal number.







    Decimal number system to binary number system

    Decimal number system to binary number system

    If we see that the number we have to get that's base (Right bottom side has given)  is 2 so we have to convert the given decimal number into an equivalent binary number. 



    In that case, we have to divide the left part of the decimal point of the given decimal number by 2(Binary base).


    Now,

    For the right part we have to multiply the part by 2.Until we get any non-decimal number we have to continue the multiplication  
    In this case, the last multiplication result we obtained will be the least significant digit and the first multiplication result will be the most significant digit. From here we have to keep the multiplication results of each step.

    Completing these steps we will get the binary number of the given decimal number.


    Here is an example of converting a decimal number into a binary number.

    Example:

    (21.125)₁₀ = (?)₂

    Solution: 
    We have to convert the given decimal number into the binary number(base=2). Here for 21, we have to divide by 2 because we have to convert it into a binary number.


    New
    number
    Division process
    Division result
    Reminder
    21
    21÷2
    10
    1
    10
    10÷2
    5
    0
    5
    5÷2
    2
    1
    2
    2÷2
    1
    0
    1
    1÷2
    0
    1

    Here the last reminder will be the most significant digit. So, we get-

    Binary of (21)₁₀ = (10101)₂

    Now right part of the point 0.125. We have to start to multiply 0.125 by 2. Next step we will take the result and multiply again. This process will continue if we don't get an integer number. 
    After getting an integer number we will immediately stop multiplying and will write the left part of each multiplication result. 

    New
    number
    Multiply
    Result
    Left part 
    of the 
    point of result
    (Need)
    0.125
    0.1252
    0.25
    0
    0.25
    0.252
    0.50
    0
    0.50
    0.502
    1.0
    1

    Here from the first result, we will make the most significant digit. So, we get-

    (0.125)₁₀ =  (0.001)₂

    So, finally, we get (21.125)₁₀ = (10101.001)₂



    The overall conversion process can be summarized like this-


    For decimal(10) to binary(2) conversion


    Divide the left part of the decimal point and multiply the right part of the decimal point of the given decimal number by binary base (2).


     Decimal number system to octal number system

    Decimal number system to octal number system


    If we see that the number we have to get that's base (Right bottom side has given)  is 8 so we have to convert the given Decimal number system to the octal number system. 

    We have to divide the left part of the decimal point of the given decimal number by 8(Octal base).
    And for the right part, we have to multiply by 8.

    Completing these steps we will get the octal number of a given decimal number.

    Here is an example of converting a decimal number into an octal number.

    (21.125)₁₀ = (?)₈

    Solution: 


    We have to convert the given decimal number into the octal number(base=8). Here for 21, we have to divide by 8 because we have to convert it into the octal number.


    New
    number
    Division process
    Division result
    Reminder
    21
    21÷8
    2
    5
    2
    2÷8
    0
    2

    Here the last reminder will be the most significant digit. So, we get-
    Octal of (21)₁₀ = (25)₈

    Now right part of the point 0.125. We have to start to multiply 0.125 by 8. 

    Next step we will take the result and multiply again. This process will continue if we don't get an integer number. 

    After getting an integer number we will immediately stop multiplying and will write the left part of each multiplication result.

    New
    number
    Multiply
    Result
    Left part of the point of the result
    0.125
    0.125✕8
    1.0
    1

    Here from the first result, we will make the most significant digit. So, we get-
    (0.125)₁₀ = (0.1)₈
    So, finally, we get (21.125)₁₀ = (25.1)₈
    (Answer)

    The overall conversion process can be summarized like this-


    For decimal(10) to octal(8) conversion


    Divide the left part of the decimal point and multiply the right part of the decimal point of the given decimal number by octal base (8).




    Decimal number system to hexadecimal number system

    Decimal number system to hexadecimal number system

    If we see that the number we have to get that's base (Right bottom side has given)  is 16 so we have to Decimal number system to hexadecimal number system. 

    In that case, we have to divide the left part of the decimal point of the given decimal number by 16(Hexadecimal base).


    We have to keep in mind that the last reminder we obtained will be the most significant digit and the first reminder will be the least significant digit. 

    Now,


    For the right part, we have to multiply the part by 16. Until we get any non-decimal number we have to continue the multiplication  


    In this case, the last multiplication result we obtained will be the least significant digit and the first multiplication result will be the most significant digit. From here we have to keep the multiplication results of each step.


    Completing these steps we will get the hexadecimal number of the given decimal number.


    Here is an example of converting a decimal number into a hexadecimal number.


    Example:


    (21.125)₁₀ = (?)₁₆


    Solution: 


    We have to convert the given decimal number into the hexadecimal number(base=16). 

    Here for 21, we have to divide by 16 because we have to convert it into a hexadecimal number.



    New
    number
    Division process
    Division result
    Reminder
    21
    21÷16
    1
    5
    1
    1÷16
    0
    1



    New
    number
    Multiply
    Result
    Left part of the point of the result
    0.125
    0.125✕16
    2.0
    2



    Here from the first result, we will make the most significant digit. So, we get-



    (0.125)₁₀ = (0.2)₁₆
    So, finally, we get (21.125)₁₀ = (15.2)₁₆



    (Answer)



    The overall conversion process can be summarized like this-


    For decimal(10) to hexadecimal(16) conversion


    Divide the left part of the decimal point and multiply the right part of the decimal point of the given decimal number by hexadecimal base (16).






    Binary number system to octal and hexadecimal number system
    • Binary to Octal number conversion
    • Binary number to hexadecimal number conversion
    Octal and hexadecimal number system to binary number system
    • Octal number system to binary number system
    • Hexadecimal number system to binary number system
    Octal number system to hexadecimal number system and hexadecimal number system to Octal number system
    • Octal number system to hexadecimal number system
    • Hexadecimal number system to octal number system conversion
    Binary to Octal number conversion

    Binary to Octal number conversion


    In Binary to Octal number conversion, We have to group by taking 3 binary digits on each side of the point. If there is short then for the left side of the point, add zeros at most left side. And for the right side of the point add zeros at the most right side. 

    Write the corresponding decimal number of 3 digits binary number for each group.

    Then convert those 3 digit binary numbers into octal numbers.


    Example: (11101.1101)₂ = (?)₈

    Solution: 

     011   101   110  100
       ↓       ↓      ↓       ↓
       3       5      6       4

    So,

        (11101.1101)₂ = (35.64)₈
    (ANSWER)




    We have added zeros before the first digit on the left side of the decimal point and after the last digit on the right side of the decimal point for making 3-bit permutations.

    Binary number to hexadecimal number conversion

    Binary number to hexadecimal number conversion

    In Binary number to hexadecimal number, conversion steps are simple. Group by taking 4 binary digits on each side of the point. 

    If there is short then for the left side of the point, add zeros at most left side. And for the right side of the point add zeros at the most right side. 

    Then convert those 4 digit binary numbers into hexadecimal number by writing corresponding decimal numbers for each group.

    Example: (11101.1101)₂ = (?)₁₆

    Solution: 

    We have to represent a 4-bit binary number for finding each hexadecimal digits.

                                            0001  1101  1101
                                   ↙              ↓            ↘
                                 1           13(D)      13(D)     

    So,

    (11101.1101)₂=(1D.D)₁₆
    (ANSWER)


    Here is the discussion on different combinations of three-bit string.


    Octal number system to binary number system

    Octal number system to binary number system 

    For converting the Octal number system to binary number system steps are simple. 

    Break each octal digit into 3 digit binary equivalent number.

    Skip the zeros from the left side for the left side of the point and the right side from the right side of the point.


    Example: (35.64)₈ = (?)₁₆

    Solution: 
                                    3           5        6         4
                             ↙           ↙           ↘         ↘
                           011        101          110       100

    So,

    (35.64)₈ = (11101.1101)₂
    (ANSWER)


    Hexadecimal number system to binary number system

    Hexadecimal number system to binary number system 

    To convert the Hexadecimal number system to a binary number system break each hexadecimal digit into 4 digit binary equivalent number.


    Skip the zeros from the left side for the left side of the point and the right side from the right side of the point.

    Example: (1D.D)₁₆ =(?)₂

    Solution: 
                                        1       D          D
                                  ↙         ↓            ↘
                              0001      1101         1101

    So,

    (1D.D)₁₆ =(11101.1101)₂
    (ANSWER)


    Octal number system to hexadecimal number system

    Octal number system to hexadecimal number system

    For converting the Octal number system to a hexadecimal number system steps are simple. Break each octal digit into a 3-bit binary equivalent number. Then

    Skip the zeros from the left side for the left side of the point and the right side from the right side of the point.


    Then group by taking 4 binary digits on each side of the point. 

    If there is short then for the left side of the point, add zeros at most left side. And for the right side of the point add zeros at the most right side. 

    Then convert those 4 digit binary numbers into a hexadecimal number.

    Example: (35.64)₈ = (?)₁₆

    Solution: 

    Here we have to represent each octal digit by a 3-bit binary number.

              3           5        6         4
        ↙           ↙           ↘         ↘
     011       101          110       100

    So,

    (35.64)₈ = (11101.1101)₂

    Again,

    We have to represent a 4-bit binary number for finding each hexadecimal digits.

               0001  1101     1101
           ↙              ↓            ↘
        1           13(D)              13(D)     

    Here we get,

    (11101.1101)₂=(1D.D)₁₆

    So, 

    (35.64)₈ = (1D.D)₁₆
         
    (ANSWER)


    Hexadecimal number system to octal number system conversion

    Hexadecimal number system to octal number system conversion

    In the Hexadecimal number system to the octal number system, conversion steps are simple. 


    Break each hexadecimal digit into 4 digit binary equivalent number. Then skip the zeros from the left side for the left side of the point and right side from the right side of the point.


    Then group by taking 3 binary digits on each side of the point. 

    If there is short then for the left side of the point, add zeros at most left side. And for the right side of the point add zeros at the most right side. 


    Then convert those 3 digit binary numbers into octal numbers.

    Example: (1D.D)₁₆ =(?)₈

    Solution: 
                                   1       D       D
                                 ↙         ↓          ↘
                           0001           1101       1101

    Here,

    (1D.D)₁₆ =(11101.1101)₂

    Again,
     011   101   110  100
       ↓       ↓      ↓       ↓
       3       5      6       4

    Here we get,

        (11101.1101)₂ = (35.64)₈

    So,

    (1D.D)₁₆ = (35.64)₈
    (ANSWER)