<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Harutyun Martirosyan</title>
    <description>The latest articles on DEV Community by Harutyun Martirosyan (@harutyun_martirosyan_c626).</description>
    <link>https://dev.to/harutyun_martirosyan_c626</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2105330%2F0742bd83-2c42-45ca-b0d2-6effc33f8d24.png</url>
      <title>DEV Community: Harutyun Martirosyan</title>
      <link>https://dev.to/harutyun_martirosyan_c626</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/harutyun_martirosyan_c626"/>
    <language>en</language>
    <item>
      <title>Binary numbers mathematical operations</title>
      <dc:creator>Harutyun Martirosyan</dc:creator>
      <pubDate>Sun, 22 Sep 2024 21:23:48 +0000</pubDate>
      <link>https://dev.to/harutyun_martirosyan_c626/binary-numbers-mathematical-operations-5287</link>
      <guid>https://dev.to/harutyun_martirosyan_c626/binary-numbers-mathematical-operations-5287</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Adding&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  1010
+ 1101
-------
 10111

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

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  1001
+ 0110
-------
  1111

Explanation:
1 + 0 = 1
0 + 1 = 1
0 + 1 = 1
1 + 0 = 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  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)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Subtracting&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  1010
-  010
-------
  1000

Explanation:
0 - 0 = 0
1 - 1 = 0
0 - 0 = 0
1 - 0 = 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  1100
- 0011
-------
  1001

Explanation:
0(becomes 2) - 1 = 1 (borrow 1)
0(becomes 1) - 1 = 0
1 - 0 = 0
1 - 0 = 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  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
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Multiplying
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    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 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;     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
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    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
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Divison
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;     11
   -----
10 | 110
    -10
   -----
      10
    - 10
   -----
      00

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      101
    ------
11 | 1111
    -11
    ------
       1
    ------
       11
      -11
    ------
       00

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      10
    ------
10 | 100
    -10
    ------
      00

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>tutorial</category>
      <category>beginners</category>
      <category>career</category>
      <category>learning</category>
    </item>
  </channel>
</rss>
