हिंदी

Binary Addition and Subtraction

Advertisements
  • Introduction Binary Addition and Subtraction 
  • 1’s and 2’s Complement for subtraction  
Maharashtra State Board: Class 11

Introduction to Binary Addition & Subtraction

Binary Addition:

The rules for binary addition are given in table: 

A B Sum  Carry Result
0 0 0 0 0
0 1 1 0 1
1 0 1 0 1
1 1 0 1 1 0

For example,
1) (1011) + (1100) 

    1   0   1   1
+  1   1   0   0 
1  0   1   1   1            

Carry 
∴ (1011)2  +   (1100)2   =   (10111)2 

Binary Subtraction:

The rules for binary subtraction are given in table: 

A B Difference  Borrow
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0

For example, 
1) (1011)2  -   (0110)2  

    1   0   1   1
-   0   1   1   0 
    1                   ←  borrow                                                   
    0   1    0   1                                            
∴ (1011)2  -   (0110)2   =    (0101)2

These rules are to be strictly followed; only then can correct results be generated. 

Maharashtra State Board: Class 11

1’s and 2’s Complement for subtraction

Subtraction using one's complement:

In a binary number, if each 1 is replaced by 0 and each 0 by 1, the resulting number is known as the one's complement of the first number.

Steps To calculate the 1's complement Subtraction 

Step 1: Find binary of A
Step 2: Find 1's complement of B
Step 3: Add step 1 with step 2
Step 4: (i) If carry 1 is present, the answer is +ve make End around carry
            (ii) If carry is absent answer is -ve find l's complement

Example: 
1) 7 - 5:

             7                 0   1    1     1                                               0    1     1     1
          -  5              - 0    1    0     1  One's Complement ⇒     +  1     0     1     0
             2                                                      Carry        →     1  0     0     0     1
                                                                                               +                       1
                                                                                                   0     0     1     0 

Subtraction using two's complement:

If 1 is added to l's complement of a binary number, the resulting number is known as the two's complement of the binary number

Steps To calculate the 2's complement Subtraction 

Step 1: Find binary of A 
Step 2: Find 2's complement of B 
Step 3: Add step 1 with step 2
Step 4: (i)  If carry 1 is present answer is +ve Delete the carry
            (ii) If carry is absent answer is -ve find 2's complement 

Example: 
1) 7 - 5:

    7                 0   1    1     1                                           0    1     1     1

 -  5              - 0    1    0     1   \[\ce{->[two's complement]}\]       +   1     0     1     1
    2                                                                          1     0     0     1     0
                                                                                ↑
                                                                        discard carry

The answer is (0010)2

Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×