Binary numbers mathematical operations

Adding

1010
+ 1101
——-
10111

Explanation:
0 + 1 = 1
1 + 0 = 1
0 + 1 = 1
1 + 1 = 0 (carry 1)
1 + 1 + 1 = 1 (carry 1)

1001
+ 0110
——-
1111

Explanation:
1 + 0 = 1
0 + 1 = 1
0 + 1 = 1
1 + 0 = 1

101
+ 1…


This content originally appeared on DEV Community and was authored by Harutyun Martirosyan

Adding

  1010
+ 1101
-------
 10111

Explanation:
0 + 1 = 1
1 + 0 = 1
0 + 1 = 1
1 + 1 = 0 (carry 1)
1 + 1 + 1 = 1 (carry 1)

  1001
+ 0110
-------
  1111

Explanation:
1 + 0 = 1
0 + 1 = 1
0 + 1 = 1
1 + 0 = 1
  101  
+  11  
-------
 1000  

Explanation:
1 + 1 = 0 (carry 1)
0 + 1 + 1(carried over) = 0 (carry 1)
1 + 0 + 1(carried over) = 10(with carried 1)

Subtracting

  1010
-  010
-------
  1000

Explanation:
0 - 0 = 0
1 - 1 = 0
0 - 0 = 0
1 - 0 = 1
  1100
- 0011
-------
  1001

Explanation:
0(becomes 2) - 1 = 1 (borrow 1)
0(becomes 1) - 1 = 0
1 - 0 = 0
1 - 0 = 1
  10000
- 00101
-------
  10111

Explanation:
0(becomes 2) - 1 = 1 (borrow 1)
0(becomes 1) - 0 = 1
0(becomes 1) - 1 = 0 
0(becomes 1)- 0 = 1
1(becomes 0) - 0 = 0

Multiplying

    101
  x  11
--------
    101   
+  101   
--------
  1111

   Explanation:
First column:   Second column:   Adding columns:
1 * 1 = 1       1 * 1 = 1        101
0 * 1 = 0       0 * 1 = 0     + 101
1 * 1 = 1       1 * 1 = 1       ----
                                1111 
     1011
  x   101
 --------
     1011   
+   0000    
+  1011   
 --------
   110111
   Explanation:
First column:   Second column:  Third column:  Adding columns:
1 * 1 = 1       1 * 0 = 0       1 * 1 = 1            1011
1 * 1 = 1       1 * 0 = 0       1 * 1 = 1       +   0000
0 * 1 = 0       0 * 0 = 0       0 * 1 = 0       +  1011
1 * 1 = 1       1 * 0 = 0       1 * 1 = 1       ---------
                                                   110111
    111
  x 111
--------
    111 
+  111   
+ 111   
--------
 110001

    Explanation:
First column:   Second column:  Third column:  Adding columns:
1 * 1 = 1       1 * 1 = 1       1 * 1 = 1           111
1 * 1 = 1       1 * 1 = 1       1 * 1 = 1       +  111
1 * 1 = 1       1 * 1 = 1       1 * 1 = 1       + 111
                                                --------
                                                 110001

Divison

     11
   -----
10 | 110
    -10
   -----
      10
    - 10
   -----
      00

      101
    ------
11 | 1111
    -11
    ------
       1
    ------
       11
      -11
    ------
       00

      10
    ------
10 | 100
    -10
    ------
      00


This content originally appeared on DEV Community and was authored by Harutyun Martirosyan


Print Share Comment Cite Upload Translate Updates
APA

Harutyun Martirosyan | Sciencx (2024-09-22T21:23:48+00:00) Binary numbers mathematical operations. Retrieved from https://www.scien.cx/2024/09/22/binary-numbers-mathematical-operations/

MLA
" » Binary numbers mathematical operations." Harutyun Martirosyan | Sciencx - Sunday September 22, 2024, https://www.scien.cx/2024/09/22/binary-numbers-mathematical-operations/
HARVARD
Harutyun Martirosyan | Sciencx Sunday September 22, 2024 » Binary numbers mathematical operations., viewed ,<https://www.scien.cx/2024/09/22/binary-numbers-mathematical-operations/>
VANCOUVER
Harutyun Martirosyan | Sciencx - » Binary numbers mathematical operations. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/09/22/binary-numbers-mathematical-operations/
CHICAGO
" » Binary numbers mathematical operations." Harutyun Martirosyan | Sciencx - Accessed . https://www.scien.cx/2024/09/22/binary-numbers-mathematical-operations/
IEEE
" » Binary numbers mathematical operations." Harutyun Martirosyan | Sciencx [Online]. Available: https://www.scien.cx/2024/09/22/binary-numbers-mathematical-operations/. [Accessed: ]
rf:citation
» Binary numbers mathematical operations | Harutyun Martirosyan | Sciencx | https://www.scien.cx/2024/09/22/binary-numbers-mathematical-operations/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.