<?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: Edita Haroyan</title>
    <description>The latest articles on DEV Community by Edita Haroyan (@edita_haroyan).</description>
    <link>https://dev.to/edita_haroyan</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%2F927024%2Fe20f51b9-b9dc-4120-ac2c-226d5e94e467.png</url>
      <title>DEV Community: Edita Haroyan</title>
      <link>https://dev.to/edita_haroyan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/edita_haroyan"/>
    <language>en</language>
    <item>
      <title>Binary numbers explained by a gen Z representative</title>
      <dc:creator>Edita Haroyan</dc:creator>
      <pubDate>Thu, 15 Sep 2022 23:31:26 +0000</pubDate>
      <link>https://dev.to/edita_haroyan/binary-numbers-explained-by-a-gen-z-representative-3de0</link>
      <guid>https://dev.to/edita_haroyan/binary-numbers-explained-by-a-gen-z-representative-3de0</guid>
      <description>&lt;p&gt;As the procrastinator I am, I tried my best to simplify binary numbers as much as possible, so here we are.&lt;br&gt;
First of all, why do we need binary numbers? Easy! It's the language of computers, and unlike us, computers are stupid. They can't learn other languages, so we need to know theirs to understand how it works.&lt;br&gt;
Let's start! "Binary" can be understood as a couple. We have 1 and 0, where "1" means something and "0" means nothing. And even though we only have two numbers, we can represent any number with them using powers of "2". Here's an example&lt;br&gt;
Let's try to convert 1 0 1 1 to a decimal&lt;br&gt;
1) The first step is counting from right to the left, starting from zero (because why would we want to do it in a normal way, we need to suffer)&lt;br&gt;
1 0 1 1&lt;br&gt;
3 2 1 0&lt;br&gt;
those are going to be the powers of two.&lt;br&gt;
1 0 1 1&lt;br&gt;
2^3 2^2 2^1 2^0&lt;br&gt;
2) Now, we multiply "2"s with the number above them and add the results&lt;br&gt;
1x2^3+0x2^2+1x2^1+1x2^0&lt;br&gt;
3) The last step is simply calculating the result&lt;br&gt;
8+0+2+1=11&lt;br&gt;
Hooray!! We got the answer, 1011 in binary equals 11 in decimal.&lt;br&gt;
Here's another example without explanation&lt;br&gt;
1 0 1 0 1 0&lt;br&gt;
1 0 1 0 1 0&lt;br&gt;
2^5 2^4 2^3 2^2 2^1 2^0&lt;br&gt;
1x2^5+0x2^4+1x2^3+0x2^2+1x2^1+0x2^0&lt;br&gt;
32+0+8+0+2+0=42&lt;br&gt;
101010=42&lt;br&gt;
Now let's do the opposite.&lt;br&gt;
We're gonna convert 35 to a binary number. There are several methods, but I like this one the best, so I'll only explain this (If you think other ways are better and I should include them, you are absolutely welcomed to go and read someone else's work, thank you:D).&lt;br&gt;
1)The first step is writing all powers of 2 in a decreasing order starting from the one that is closest to our number, and that would be&lt;br&gt;
32 16 8 4 2 1&lt;br&gt;
2) Now, starting from the biggest one, we're trying to understand whether it will be a 1 or 0. If we're gonna use the number, we write 1 and distract the number from the original. If not, then we write 0.&lt;br&gt;
32 16 8 4 2 1&lt;br&gt;
32 we will use, so it's a 1. Now we distract it from 35, and we are left with 3. 16 8 4 we won't need because they are bigger than 3, so all of them are 0. 2 and 1 we will use, so those are 1&lt;br&gt;
Now we have this&lt;br&gt;
100011&lt;br&gt;
And if we want to check, we can try to convert it again, which will give us exactly 35&lt;br&gt;
Here's another example&lt;br&gt;
47&lt;br&gt;
32 16 8 4 2 1&lt;br&gt;
1  0  1 1 1 1&lt;br&gt;
47-32=15, 15-8=7, 7-4=3, 3-2=1, 1-1=0&lt;/p&gt;

&lt;p&gt;We have 101111&lt;/p&gt;

&lt;p&gt;That was conversion. Now let me present another medieval tortu- I mean things we can do with binary numbers. Those are adding, multiplying, substracting and dividing, basically 4th class stuff.&lt;br&gt;
1) Adding&lt;br&gt;
Let's try to add these&lt;br&gt;
1 0 1 1   1 1 0 0&lt;br&gt;
We put them like second graders do. When we add 0 to 1, we get 1, same with 1+0. And obviously, we get 0 when adding two zeros. However, we don't have the number "2" in binary numbers. So when we add 1 to 1, we &lt;strong&gt;carry&lt;/strong&gt; one "1" to the left side and write a 0.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vgqYII3Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ux0clqdekyngj4mta8nf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vgqYII3Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ux0clqdekyngj4mta8nf.png" alt="Image description" width="391" height="453"&gt;&lt;/a&gt;&lt;br&gt;
And we got 10111. From conversion, we know that 1011 equals 11 and 1100 equals 12, so the sum would be 23. And indeed, 10111 is equal to 23.&lt;br&gt;
Another example &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tJADmvo1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k19l6zzs6dfg75huizr5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tJADmvo1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k19l6zzs6dfg75huizr5.png" alt="Image description" width="210" height="167"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2) Multiplying&lt;br&gt;
1001  1100&lt;br&gt;
Basically, multiplying the first number separately with all the numbers of the second number and then adding. Here's another masterpiece I made in paint&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Lv58ZeI9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ipujumfpqnqgwjau3jk7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Lv58ZeI9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ipujumfpqnqgwjau3jk7.png" alt="Image description" width="355" height="383"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see we multiply 1001 with numbers of 1100, then add. So we got 1101100. Another way would be just converting from binary to decimal, multiplying and converting back to binary.&lt;br&gt;
Here's another example&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KDK2KrDz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ob4padh8kwa9nin961v3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KDK2KrDz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ob4padh8kwa9nin961v3.jpg" alt="Image description" width="252" height="231"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3) Subtraction! Also like the second grader stuff. Substracting 1 from 1 gives 0, so does 0 from 0, and 0 from 1. However, when we need to subtract 1 from 0, we borrow from the left side and write 1.&lt;br&gt;
Let's subtract 101 from 1111&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--majaN5wG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tkw37lpccx1hsd4irdcz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--majaN5wG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tkw37lpccx1hsd4irdcz.png" alt="Image description" width="203" height="268"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's an example I borrowed from wikihow&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jRrYh2zR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n3hmbuafa1lspyvwuny7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jRrYh2zR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n3hmbuafa1lspyvwuny7.png" alt="Image description" width="363" height="316"&gt;&lt;/a&gt;&lt;br&gt;
As you can see, we needed to borrow a few times to get to the answer&lt;/p&gt;

&lt;p&gt;4)Division. I find the easiest method to divide the decimals and then convert them, so no explanation here.&lt;/p&gt;

&lt;p&gt;SENK YU for your attention.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>binary</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Binary explained from a gen Z representative</title>
      <dc:creator>Edita Haroyan</dc:creator>
      <pubDate>Thu, 15 Sep 2022 22:21:31 +0000</pubDate>
      <link>https://dev.to/edita_haroyan/binary-explained-from-a-gen-z-representative-4k21</link>
      <guid>https://dev.to/edita_haroyan/binary-explained-from-a-gen-z-representative-4k21</guid>
      <description>&lt;p&gt;As the procrastinator I am, I tried my best to simplify binary numbers as much as possible, so here we are. &lt;br&gt;
First of all, why do we need binary numbers? Easy! It's the language of computers, and unlike us, computers are stupid. They can't learn other languages, so we need to know theirs to understand how it works. &lt;br&gt;
Let's start! "Binary" can be understood as a couple. We have 1 and 0, where "1" means something and "0" means nothing. And even though we only have two numbers, we can represent any number with them using powers of "2". Here's an example &lt;br&gt;
  Let's try to convert 1 0 1 1 to a decimal&lt;br&gt;
1) The first step is counting from right to the left, starting from zero (because why would we want to do it in a normal way, we need to suffer) &lt;br&gt;
    1 0 1 1 &lt;br&gt;
    3 2 1 0&lt;br&gt;
those are going to be the powers of two. &lt;br&gt;
      1      0     1      1&lt;br&gt;
     2^3    2^2   2^1    2^0&lt;br&gt;
2) Now, we multiply "2"s with the number above them and add the results&lt;br&gt;
   1x2^3+0x2^2+1x2^1+1x2^0&lt;br&gt;
3) The last step is simply calculating the result&lt;br&gt;
   8+0+2+1=11&lt;br&gt;
Hooray!! We got the answer, 1011 in binary equals 11 in decimal.&lt;br&gt;
Here's another example without explanation&lt;br&gt;
  1 0 1 0 1 0&lt;br&gt;
  1      0      1      0       1     0&lt;br&gt;
  2^5   2^4    2^3    2^2     2^1   2^0&lt;br&gt;
  1x2^5+0x2^4+1x2^3+0x2^2+1x2^1+0x2^0&lt;br&gt;
  32+0+8+0+2+0=42&lt;br&gt;
  101010=42&lt;br&gt;
Now let's do the opposite.&lt;br&gt;
We're gonna convert 35 to a binary number. There are several methods, but I like this one the best, so I'll only explain this (If you think other ways are better, you are absolutely welcomed to go and read someone else's work, thank you:D).&lt;br&gt;
1)The first step is writing all powers of 2 in decreasing order to the one that is closest to our number, and that would be &lt;br&gt;
32 16 8 4 2 1 &lt;br&gt;
2) Now, starting from the biggest one, we're trying to understand whether it will be a 1 or 0. If we're gonna use the number, we write 1 and distract the number from the original. If not, then 0. &lt;br&gt;
32 16 8 4 2 1&lt;br&gt;
32 we will use, so it's a 1. Now we distract it from 35, and we are left with 3. 16 8 4 we won't need because they are bigger than 3, so all of them are 0. 2 and 1 we will use, so those are 1&lt;br&gt;
Now we have this&lt;br&gt;
100011&lt;br&gt;
And if we want to check, we can try to convert it again, which will give us exactly 35&lt;br&gt;
Here's another example &lt;br&gt;
 47 &lt;br&gt;
 32 16 8 4 2 1&lt;br&gt;
32 use-1 &lt;br&gt;
47-32=15&lt;br&gt;
16 no -0&lt;br&gt;
8 use -1&lt;br&gt;
15-8=7&lt;br&gt;
4 use-1&lt;br&gt;
7-4=3&lt;br&gt;
2 use -1&lt;br&gt;
3-2=1&lt;br&gt;
1 use -1&lt;br&gt;
 We have 101111&lt;/p&gt;

&lt;p&gt;That was conversion. Now let me present another medieval tortu- I mean things we can do with binary numbers. Those are adding, multiplying, basically 4th class stuff. &lt;br&gt;
1) Adding&lt;br&gt;
Let's try to add these&lt;br&gt;
1 0 1 1      1 1 0 1&lt;br&gt;
We put them like so and put "+" in the middle from the left side, which I can't do when writing here&lt;br&gt;
       1 0 1 1&lt;br&gt;
       1 1 0 0&lt;br&gt;
When we add 0 to 1, we get 1, same with 1+0. And obviously, we get 0 when adding two zeros. However, we don't have the number "2" in binary numbers. So when we add 1 to 1, we carry one "1" to the left side and write a 0.&lt;br&gt;
        1 0 1 1&lt;br&gt;
        1 1 0 0&lt;br&gt;
      1 0 1 1 1&lt;br&gt;
And we got 10111. From conversion, we know that 1011 equals 11 and 1100 equals 12, so the sum would be 23. And indeed, 10111 is equal to 23.&lt;/p&gt;

&lt;p&gt;2) Multiplying &lt;br&gt;
1001  1100 &lt;br&gt;
Basically, multiplying the first number separately with all the numbers of the second number and then adding. Here's the masterpiece I made in paint&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CHTexiCP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i03bk9d384d6wjkf9fhk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CHTexiCP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i03bk9d384d6wjkf9fhk.png" alt="Image description" width="355" height="383"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see we multiply 1001 with numbers of 1100, then add. So we got 1101100. Another way would be just converting from binary to decimal, multiplying and converting back to binary. &lt;br&gt;
For now that's all&lt;br&gt;
Senk yu for your attention!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>computerscience</category>
      <category>binary</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
