Thursday, 1 September 2022

Binary number system, Conversion and arithmetic operations

 BINARY NUMBER SYSTEM

The number system which we use in our daily life is decimal number system. We can represent all digits from zero to infinity as a combination of numbers from 0 to 9. For example, 63 is represented as a combination of 6 and 3. In decimal system, each digit used to represent a particular number has a particular weight. A digit in unit place, has a lesser weight than a digit in ten's place. This is clear from the following illustration. 

    Let a decimal number be "ABCD". Here A, B, C, D are all decimal digits. The weight of these digits are given below :

    Weight ⟶       10³           10²         10¹       10⁰

    Digit  ⟶           A              B             C           D

    Therefore, the number 'N' can be written as

         N = A × 10³ + B × 10² + C × 10¹ + D × 10⁰

     If A = 5, B = 3, C = 7, D = 0

    Then N = 5 × 10³ + 3 × 10² + 7 × 10¹ + 0 × 10⁰

                  = 5000 + 300 + 70 + 0

                  = 5370.

    Binary system runs in a similar manner with a difference that it expresses all numbers as a combination of 0 and 1 while the 'weight' is assigned to the place as powers of 2 (instead of powers of 10 as in decimal system) : 0 and 1 are called binary digits or simply bits ('b' is taken from binary and 'it's from digits). 

    Illustration. Let a number written in binary system be 01011.

    Weight ⟶     2⁴         2³        2²          2¹         2⁰ 

    Digit ⟶         0           1          0            1          1

    Therefore, the number 'N' can be written as 

       N = 0 ×2⁴ + 1 × 2³ + 0 × 2² + 1 × 2¹ + 1 × 2⁰

           = 0 + 8 + 0 + 2 + 1

           = 11

    Thus, '01011' in binary system represents 11 in decimal system. 

Conversion of a number from binary system to decimal system

Procedure

  1. Write the binary number and then multiply the binary number with the power of 2 (from right to left). 
  2. Add the products after multiplication. 
  3. That is the decimal equivalent of the binary number. 

Example


     Therefore, the required decimal number is "52". The result can be written in either of the following two ways :

                (110100)₂ = (52)₁₀

                (110100)binary = (52)decimal

Conversion of a number from binary system to octal system

     As we know in octal system there is  3 digits. 

   

NumbersBinary form
0 0       0       0
1 0       0       1
2 0       1       0
3 0       1       1
4 1       0       0
5 1       0       1
6 1       1       0
7 1       1       1

  1. First write the binary numbers; example - 110010.
  2. Then grouped them in 3 digits; example - 110     010.
  3. Write the value of each 3 digits; example - 110 = 6, 010 = 2.
  4. Then add the values ; example - 110010 = 62.
  5. That is the octal equivalent of the binary number. 

Example


     Therefore, the required octal number is "64". The result can be written in either of the following two ways :

              (110010)₂ = (64)₈
       
              (110010)binary = (64)octal 

Conversion of a number from binary system to hexadecimal system

     As we know in hexadecimal system there is 4 digits. 

Numbers    Binary form
0 0      0      0      0
1 0      0      0      1
2 0      0      1      0
3 0      0      1      1
4 0      1      0      0
5 0      1      0      1
6 0      1      1      0
7 0      1      1      1
8 1      0      0      0
9 1      0      0      1
10 (A)  1      0      1      0
11 (B) 1      0      1      1
12 (C)  1      1      0      0
13 (D)  1      1      0      1
14 (E)  1      1      1      0
15 (F)  1      1      1      1
 

  1. First write the binary numbers; example - 10011100.
  2. Then grouped them in 4 digits; example - 1001     1100.
  3. Write the value of each 4 digits; example - 1001 = 9,  1100 = 12.
  4. Then add the values; example - 10011100 = 912 = 9C.
  5. That is the hexadecimal equivalent of the binary number. 

Example


     Therefore, the required hexadecimal number is "34". The result can be written in either of the following two ways :

             (110100)₂ = (34)₁₆

             (110100)binary = (34)hexadecimal 

Conversion of a number from decimal system to binary system

Procedure

  1. Take the integral decimal number and divided by 2.
  2. Represent the reminder value at the right hand side. 
  3. Assume the quotient value as the dividend and continue the step 1 and 2 untill unless you are not getting the quotient value below 2.
  4. Represent the right hand side value from button to top. 
  5. This is the binary equivalent of the decimal number. 

Example 


       Let us write 52 in binary system


     Therefore, the required binary number is "110100". The result can be written in either of 5he following two ways :

                      (52)₁₀ = (110100)₂ 

    or             (52)decimal = (110100)binary   

     It may be noted that the indices 10 and 2 in the two representations give the base of the system of representation. 

     This can be easily verified as follows

     Weight ⟶   2⁵     2⁴      2³      2²      2¹      2⁰

     Bites ⟶       1       1        0       1        0       0     

    ∴     N = 1 × 2⁵ + 1 × 2⁴ + 0 × 2³ + 1 × 2² + 0 × 2¹ + 0 × 2⁰

              = 32 + 16 + 4

              = 52

Conversion of a number from decimal to octal

Procedure

  1. Take the decimal number and divided by 8.
  2. Represent the reminder value at the right hand side. 
  3. Assume the quotient as dividend and continue step 1 and 2 until unless you are not getting a value less than 8.
  4. Represent the right hand side value from buttom to top. 
  5. That is the octal equivalent of the decimal number. 

Example 

      Let us write 165 in octal system


     Therefore, the required octal number is "245". The result can be written in either of the following two ways :

                     (165)₁₀ = (245)₈

     or            (165)decimal = (245)octal      

     It may be noted that the indices 10 and 8 in the two representations give the base of the system of representation. 

     This can be easily verified as follows

     Weight ⟶      8²        8¹        8⁰

      Bites ⟶         2          4          5

     ∴     N = 2 × 8² + 4 × 8¹ + 5 × 8⁰

                = 128 + 32 + 5

                = 165

Conversion of a number from decimal system to hexadecimal system

Procedure

  1. Take the decimal number and divided by 16.
  2. Represent the reminder value of the result at right hand side. 
  3. Assume the quotient value of the result on dividend and continue step 1 and 2 until unless you are not getting value less than 16.
  4. Represent the right hand side value from buttom to top. 
  5. That is the hexadecimal equivalent of the decimal number. 

Example


     Therefore, the required hexadecimal number is "2A". The result can be written in either of the following two ways :

                      (42)₁₀ = (2A)₁₆

     or             (42)decimal = (2A)hexadecimal

     It may be noted that the indices 10 and 16 in the two representations give the base of the system of representation. 

     This can be easily verified as follows

     Weight ⟶      16¹        16⁰

     Bites ⟶           2            10

     ∴     N = 2 × 16¹ + 10 × 16⁰

                = 32 + 10

                = 42

Conversion of a number from octal system to binary system

     We know in octal system there is 3 digits. 

  1. First write the octal numbers; example - (305)₈
  2. Then write the binary numbers of each octal numbers; example - 3 = 011, 0 = 000, 5 = 101.
  3. Add the binary numbers; 011   000   101 = 011000101.
  4. That is the binary equivalent of the octal number.    

Example

     Therefore, the required binary number is "010100101". The result can be written in the following two ways :

             (245)₈ = (010100101)₂

             (245)octal = (010100101)binary  

Conversion of a number from octal system to decimal system

  1. Write the octal number and then multiply the octal numbers with the power of 8 (from right to left). 
  2. Add the products after multiplication. 
  3. Then the final result is the decimal equivalent of the octal number. 

Example 

     Therefore, the required decimal number is "165". The result can be written in either of the following two ways :
    
               (245)₈ = (165)₁₀
          
               (245)octal = (165)decimal

Conversion of a number from octal system to hexadecimal system

     We know in hexadecimal system there us 4 digits. 

  1. First write the octal number; example - 425.
  2. Then write the binary numbers of each octal numbers; example - 4 = 0100, 2 = 0010, 5 = 0101.
  3. Add the binary numbers like this - 0100   0010     0101 = 010000100101 = 115.
  4. The final result is the hexadecimal equivalent of the octal number. 

Example


     Therefore, the required hexadecimal number is "A5". The result can be written in the following two ways :

             (245)₈ = (A5)₁₆

             (245)octal = (A5)hexadecimal 

Conversion of a number from hexadecimal system to binary system

  1. Write the hexadecimal number; example - 8B  (B = 12).
  2. Then write the binary numbers if each hexadecimal number; example - 8 = 1000, 12 = 1100.
  3. Add the binary numbers; example - 10001100.
  4. That is the binary equivalent of the hexadecimal number. 

Example


     Therefore, the required binary number is "101010". The result can be written in the following two ways :

              (2A)₁₆ = (101010)₂

              (2A)hexadecimal = (101010)binary 

Conversion of a number from hexadecimal system to decimal system

  1. Take the hexadecimal number; example - 6C (C = 13).
  2. Multiply the hexadecimal number with the power of 16; example - 6 × 16¹ + 13 × 16⁰.
  3. Add the product after multiplication. 
  4. The final result is the decimal equivalent of the hexadecimal number. 

Example


     Therefore, the required decimal number is "42". The result can be written in the following two ways :

                 (2A)₁₆ = (42)₁₀

                 (2A)hexadecimal = (42)decimal 

Conversion of a number from hexadecimal system to octal system

     We know in octal system there is 3 digits. 

  1. Take the hexadecimal number; example - 3B (B=11). 
  2. Write the hexadecimal numbers into binary numbers; example - 3 = 0011, 11 = 1011.
  3. Then grouped them in 3 digits like this - 00111011 = 111   011.
  4. Write the octal number of each binary numbers like this - 111 = 7,  011 = 3.
  5. Add the octal numbers = 73.
  6. The final result is the octal equivalent of the hexadecimal number. 

Example

    
     Therefore, the required octal number is "52". The result can be written in the following two ways :

            (2A)₁₆ = (52)₈

            (2A)hexadecimal = (52)octal 


Addition in binary system - "concept of carry"

Let us suppose the reading of speedometer of a car at any instant is 000999. When the next kilometer is covered one has to be added to the first nine on the right hand side (in unit place). So, it becomes 0 and 1 is added  at tens place. This 1, which is added to the next place when the count at a particular place increases to highest digit of the system is called carry. So, addition of 0 and 1 is 1. In case of addition of 1 and 1 the result increases beyond the highest available digit (1) in binary system. So, we write 0 and carry 1 to the next column as was done in case of addition of 000999 + 1. Thus, following rule shall be obeyed in addition of binary system. 

     (i) 0 + 0 = 0                      

    (ii) 0 + 1 = 1

   (iii) 1 + 0 = 1                   

   (iv) 1 + 1 = 0 ;   carry 1

Example


     1011 = 11,    0111 = 7

     1011 + 0111 = 10010

      (11)  +  (7)    = 18

Subtraction in binary system 

Subtraction of binary numbers result is binary number. 

     (i) 0 - 0 = 0

    (ii) 0 - 1 = 1 ; borrow 1

   (iii) 1 - 0 = 1

   (iv) 1 - 1 = 0

Example

     1101 = 13,   0110 = 6

     1101 - 0110 = 0111

      (13)  -  (6)    = 7

Multiplication in binary system

Multiplication of binary numbers is same as multiplication of natural numbers. 

Example


     0101 = 5,   1101 = 13

     0101 × 1101 = 1000001

     (5)    ×   (13) = 65

Division in binary system

Division of binary numbers is similar to division of natural numbers. 

Example


     1100 = 12,   10 = 2

     1100 ÷ 10 = 110

      (12) ÷ (2) = 6

No comments:

Post a Comment

PHOTO ELECTRIC EFFECT - DEFINITION, LAW AND EINSTEIN'S THEORY

 Photo electric effect Consider a negativity charged zinc plate connected to a gold leaf electroscope (Fig. 1). The divergence in the leaves...