<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ systems - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ systems - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Mon, 25 May 2026 05:06:37 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/systems/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ Signal Processing and Systems in Programming – Guide for Beginners ]]>
                </title>
                <description>
                    <![CDATA[ Signal processing is an important field in engineering and programming.  Basically, it allows engineers and programmers to improve data so that people can use it more effectively. For example, it is thanks to signal processing that much of the backgr... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/signal-processing-and-systems-in-programming/</link>
                <guid isPermaLink="false">66ba5345cccc49d721b6ea21</guid>
                
                    <category>
                        <![CDATA[ data ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Signal Processing ]]>
                    </category>
                
                    <category>
                        <![CDATA[ systems ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Tiago Capelo Monteiro ]]>
                </dc:creator>
                <pubDate>Wed, 06 Sep 2023 14:49:58 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2023/03/pexels-igor-mashkov-6325003.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Signal processing is an important field in engineering and programming. </p>
<p>Basically, it allows engineers and programmers to improve data so that people can use it more effectively.</p>
<p>For example, it is thanks to signal processing that much of the background noise in a phone call is removed. This way, only your voice arrives on the other end of the call.</p>
<p>Other examples are:</p>
<ul>
<li>Audio and music software</li>
<li>Image and video processing software</li>
<li>Medical imaging software </li>
<li>Speech and language processing software </li>
<li>Wireless communication software</li>
</ul>
<p>Understanding signal processing and systems is key for any programmer who needs to process, manipulate, and analyze these types of data.</p>
<p>This tutorial will explore the field of signal processing and the main characteristics of a system, including some important system characteristics such as:</p>
<ul>
<li>Causality</li>
<li>Memory</li>
<li>Time-invariance</li>
<li>Linearity</li>
</ul>
<p>Here's what we'll cover:</p>
<ol>
<li><a class="post-section-overview" href="#heading-what-is-signal-processing">What is Signal Processing?</a></li>
<li><a class="post-section-overview" href="#heading-python-code-example-how-to-filter-a-signal">Python Code Example – How to Filter a Signal</a></li>
<li><a class="post-section-overview" href="#heading-background-on-the-fourier-transform">Background on the Fourier Transform</a></li>
<li><a class="post-section-overview" href="#heading-what-is-a-system-in-signal-processing">What is a System in Signal Processing</a>?</li>
<li><a class="post-section-overview" href="#heading-conclusion">Conclusion</a></li>
</ol>
<h2 id="heading-what-is-signal-processing">What is Signal Processing?</h2>
<p>Signal processing, simply explained, is the field where tools are created for engineers and programmers to manipulate certain signals to solve problems.</p>
<p>It involves analyzing sounds or images to extract only the needed data.</p>
<p>For example, the data from biosensors that shows how much oxygen there is in your blood is displayed in a pulse oximeter. This data is filtered with the help of tools from signal processing.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/08/pexels-cottonbro-studio-7580256.jpg" alt="Image" width="600" height="400" loading="lazy">
<em><a target="_blank" href="https://www.pexels.com/photo/index-finger-in-blue-pulse-oximeter-7580256">Photo by cottonbro studio</a></em></p>
<p>This data processed in a program inside the oximeter with the help of signal processing software tools.</p>
<p>Also, when you're making a phone call to a friend, signal processing algorithms are running so that only your voice gets sent to your friend to reduce as much background noise as possible.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/08/pexels-karolina-grabowska-4195335.jpg" alt="Image" width="600" height="400" loading="lazy">
<em><a target="_blank" href="https://www.pexels.com/photo/charging-smartphone-and-white-earphones-on-wooden-table-4195335/">Photo by Karolina Grabowska</a></em></p>
<p>Often, signal processing works with the help of tools like the <strong>Fast Fourier Transform</strong>. And don't worry – I'll explain what this is.</p>
<p>Using the Fast Fourier Transform algorithm, we are able to decompose a signal to find the individual waves that make it up.</p>
<p>This way, we are able to remove the individual waves that we don't want (for example, the background noise of a phone call is a set of waves we can remove to improve quality).</p>
<p>The Fast Fourier Transform is also used as a building block or inspiration for some file compression algorithms.</p>
<p>In the end, this is what signal processing is all about: decomposing a signal to extract what we want from it.</p>
<h3 id="heading-where-is-signal-processing-used-in-real-life">Where is signal processing used in real life?</h3>
<ul>
<li>Audio processing – like removing the background noise from a movie</li>
<li>Image processing – like making the image black and white</li>
<li>Wireless communications systems – like modulating a signal so that it can travel further (frequency modulation)</li>
</ul>
<h2 id="heading-python-code-example-how-to-filter-a-signal">Python Code Example – How to Filter a Signal</h2>
<p>You don't need to understand the full code I am about to show you right now – this is just the code I used to generate the graphs I will show you to help you understand how the Fast Fourier Transform works.</p>
<p>I've shared the full code in the conclusion in a GitHub repository so you can check it out.</p>
<p>Here is the code that filters a signal:</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">import</span> matplotlib.pyplot <span class="hljs-keyword">as</span> plt

t = np.linspace(<span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">300</span>, endpoint=<span class="hljs-literal">False</span>)
x = np.sin(<span class="hljs-number">2</span>np.pi10t)
y = <span class="hljs-number">0.5</span>np.sin(<span class="hljs-number">2</span>np.pi20t)
w = <span class="hljs-number">0.2</span>np.sin(<span class="hljs-number">2</span>np.pi50t)
z = x + y + w

zf = np.fft.fft(z)

N = len(z)
freq = np.fft.fftfreq(N, d=t[<span class="hljs-number">1</span>]-t[<span class="hljs-number">0</span>])
spectrum = <span class="hljs-number">2</span>/N * np.abs(zf[:N//<span class="hljs-number">2</span>])

mask = np.ones(len(freq), dtype=bool)
mask[(freq &gt; <span class="hljs-number">15</span>) &amp; (freq &lt; <span class="hljs-number">60</span>)] = <span class="hljs-literal">False</span>
mask[(freq &lt; <span class="hljs-number">-15</span>) &amp; (freq &gt; <span class="hljs-number">-60</span>)] = <span class="hljs-literal">False</span>

zf_filtered = zf.copy()
zf_filtered[~mask] = <span class="hljs-number">0</span>

z_filtered = np.fft.ifft(zf_filtered)
</code></pre>
<p>Below i will show visually what each part of the code does with graphs:</p>
<h3 id="heading-step-1-creating-the-signals">Step 1: Creating the signals</h3>
<pre><code>t = np.linspace(<span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">300</span>, endpoint=False)
x = np.sin(<span class="hljs-number">2n</span>p.pi10t)
y = <span class="hljs-number">0.5n</span>p.sin(<span class="hljs-number">2n</span>p.pi20t)
w = <span class="hljs-number">0.2n</span>p.sin(<span class="hljs-number">2n</span>p.pi50*t)
z = x + y + w
</code></pre><p><img src="https://www.freecodecamp.org/news/content/images/2023/08/Figure_1.png" alt="Image" width="600" height="400" loading="lazy">
<em>Three different signals and a green signal representing their sum</em></p>
<p>We can see here that the green signal is the sum of:</p>
<ul>
<li>Red wave – X signal</li>
<li>Blue wave – Y signal</li>
<li>Orange wave – W signal</li>
</ul>
<p>Note that any signal can be composed of a certain number of simple waves. In mathematics, these waves are the sine and cosine functions.</p>
<p>This incredibly important idea is called a Fourier series.</p>
<p>Below is a video I recommend that explains simply what a Fourier series is:</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/UKHBWzoOKsY" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<h3 id="heading-step-2-creating-a-fast-fourier-transform-on-the-signal-z">Step 2: Creating a Fast Fourier Transform on the signal Z</h3>
<p>We can apply the Fast Fourier Transform like this:</p>
<pre><code>zf = np.fft.fft(z)
</code></pre><p>To make a graph out of it, we still need to do the following:</p>
<pre><code>N = len(z)
freq = np.fft.fftfreq(N, d=t[<span class="hljs-number">1</span>]-t[<span class="hljs-number">0</span>])
spectrum = <span class="hljs-number">2</span>/N * np.abs(zf[:N<span class="hljs-comment">//2])</span>
</code></pre><p><img src="https://www.freecodecamp.org/news/content/images/2023/08/Figure_2.png" alt="Image" width="600" height="400" loading="lazy">
<em>Seeing the green signal in terms of frequency instead of time - We are "seeing" the green signal from another point of view</em></p>
<p>Thanks to the Fast Fourier Transform, we are able to see the composition of the green signal. </p>
<p>As we can see, the green signal is composed of 3 waves with 3 different frequencies:</p>
<ul>
<li>10 hertz – Red wave – X signal</li>
<li>20 hertz – Blue wave – Y signal</li>
<li>50 hertz – Orange wave – W signal</li>
</ul>
<h3 id="heading-step-3-creating-and-applying-the-filter">Step 3: Creating and applying the filter</h3>
<pre><code>mask = np.ones(len(freq), dtype=bool)
mask[(freq &gt; <span class="hljs-number">15</span>) &amp; (freq &lt; <span class="hljs-number">60</span>)] = False
mask[(freq &lt; <span class="hljs-number">-15</span>) &amp; (freq &gt; <span class="hljs-number">-60</span>)] = False

zf_filtered = zf.copy()
zf_filtered[~mask] = <span class="hljs-number">0</span>

z_filtered = np.fft.ifft(zf_filtered)
</code></pre><p><img src="https://www.freecodecamp.org/news/content/images/2023/08/Figure_3.png" alt="Image" width="600" height="400" loading="lazy">
<em>Filtered X signal from the green signal - Only the 10 hertz signal passes</em></p>
<p>This filter is called a pass-band filter, because it filters all the frequencies between 30 hertz and 60 hertz.</p>
<p>So, this filtered red signal is essentially the <strong>original</strong> red signal.</p>
<h2 id="heading-background-on-the-fourier-transform">Background on the Fourier Transform</h2>
<p>The idea that any signal can be represented by the sum of simple waves was created by the mathematician Joseph Fourier.</p>
<p>These waves are called sine and cosine.</p>
<p>Note: you don't need to understand these equations completely – I'm just showing them so you can understand the history of the Fourier Transform.</p>
<p>This is what is called a Fourier series:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/08/fourier-series-1.png" alt="Image" width="600" height="400" loading="lazy">
<em>Equation for Fourier series</em></p>
<p><a target="_blank" href="https://cdn1.byjus.com/wp-content/uploads/2020/11/Fourier-series-formula.png">Here is a better image of  the equation</a></p>
<p>The coefficients are given by the following:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/08/fourier-series-2.png" alt="Image" width="600" height="400" loading="lazy">
<em>Coefficients of the Fourier series</em></p>
<p>From the Fourier series the Fourier transform can be deduced:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/08/fourier-tra-1.png" alt="Image" width="600" height="400" loading="lazy">
<em>Fourier transform equation</em></p>
<p><a target="_blank" href="https://abakcus.com/wp-content/uploads/2021/09/Fourier-Transform-Equations-That-Changed-the-World-Abakcus-scaled.jpg">H</a>ere is a better image of the formula</p>
<p>However, the Fourier transform was developed by various mathematicians and physicists over the years.</p>
<p>So, it was based on the work of many scholars over time that we were able to redefine the Fourier transform. </p>
<p>But this is not the pure mathematical complicated expression that is running in a computer.</p>
<p>In a computer, it is an algorithm that approximates very well the Fourier transform called the <strong>Fast Fourier Transform</strong>.</p>
<p>That is where in the code the FFT comes from:</p>
<pre><code>zf = np.fft.fft(z)
</code></pre><p><code>fft</code> stands for Fast Fourier Transform.</p>
<p>Here are the docs with the function:</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://numpy.org/doc/stable/reference/generated/numpy.fft.fft.html">https://numpy.org/doc/stable/reference/generated/numpy.fft.fft.html</a></div>
<p>But you might be asking...</p>
<h3 id="heading-why-use-the-fast-fourier-transform">Why use the Fast Fourier Transform?</h3>
<p>Because the Fast Fourier Transform <strong>runs much faster</strong> than the pure mathematical equation.</p>
<p>There is even a whole field of mathematics dedicated to finding algorithms that approximate pure math so that computers can run it really fast.</p>
<p>This field is called <strong><a target="_blank" href="http://www.scholarpedia.org/article/Numerical_analysis">Numerical Analysis</a>.</strong></p>
<p>It is also used to find approximate solutions for problems that are impossible to find by hand.</p>
<p>For example, in the field of partial differential equations, many solutions to partial differential equations are only solved with numerical analysis methods running on computers.</p>
<p>This way, thanks to this field of mathematics, companies are able to save millions in energy costs</p>
<p>If you are interested in learning more about numerical analysis, I've included some more resources in the conclusion.</p>
<p>Changing the topic slightly, now we will talk about systems</p>
<h2 id="heading-what-is-a-system-in-signal-processing">What is a System in Signal Processing?</h2>
<p>A system is a combination of many “things” that work together as if they were a whole.</p>
<p>An example of a system could be a computer or a car.</p>
<p>In signal processing, a system is often a combination of software and hardware in a technology that takes an input signal and produces an output signal.</p>
<p>For example, when pressing the acceleration pedal in a car (input), the car goes faster (output).</p>
<p>Knowing the characteristics of a system is important for understanding how it will process the signal.</p>
<p>Four important characteristics of a system are:</p>
<ul>
<li>Causality</li>
<li>Memory</li>
<li>Time-invariance</li>
<li>Linearity</li>
</ul>
<p>But, why is it important to understand the main characteristics of a system in programming?</p>
<p>By understanding these characteristics, you will understand better how to design software (in this case, the system can be seen as software) as well as how to optimize and integrate it.</p>
<p>Knowing these characteristics is very important in systems engineering where they are applied to software development. They help you manage the complexity of programs, define their requirements, and ensure quality, adaptability and scalability.</p>
<p>If you want to learn more about systems engineering, <a target="_blank" href="https://www.freecodecamp.org/news/what-is-systems-engineering/">you can read my article on it</a>.</p>
<p>So, let's learn more about what each of these characteristics are.</p>
<h3 id="heading-causality">Causality</h3>
<p>Causality is the property of a system where the output depends on past and present input <strong>only</strong>.</p>
<p>For example, when predicting the weather, it is only possible to use past weather data to make a forecast. </p>
<p>It is not possible to use future weather data to predict the weather.</p>
<h3 id="heading-memory">Memory</h3>
<p>Memory is the property of a system where the output depends on past inputs.</p>
<p>Recommendation systems used by websites like Netflix and Amazon suggest movies or products based on a user's previous interactions.</p>
<p>The algorithms take into account products viewed or purchased, and use this information to recommend similar items.</p>
<p>With more data gathered over time, recommendations become more accurate and personalized.</p>
<p>Memory is important in programming because it allows us to create systems that can learn and adapt over time – for example, machine learning systems.</p>
<h3 id="heading-time-invariance">Time-invariance</h3>
<p>Time-invariance is the property of a system when the output does not depend on when the input was applied.</p>
<p>Real-time control systems used in robotics, manufacturing, and aerospace applications rely on time-invariant systems.</p>
<p>For instance, a flight control system must respond quickly and accurately to changes in an aircraft's position, irrespective of when they occur.</p>
<h3 id="heading-linearity">Linearity</h3>
<p>Linearity in programming is like a recipe where doubling the ingredients results in a proportionally doubled output, allowing for predictable and accurate results.</p>
<p>Linearity refers to the property of a system where the output is directly proportional to the input.</p>
<p>This means that if the input is doubled, the output will also be doubled.</p>
<p>For example, in digital image processing, linearity is used in techniques such as contrast adjustment and color correction to ensure that the output is proportional to the input. </p>
<p>This results in predictable and accurate image processing.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Signal processing and systems are essential for programming because they allow us to process, manipulate, and analyze data in a reliable and predictable way.</p>
<p>Whether you are working on audio processing, image processing, or any other application that involves signal processing, understanding the fundamentals of signal processing and systems is crucial for success.</p>
<p>Systems are closely related to signal processing, because they allow the transformation of signal for programmers and engineers to reach their desired goal.</p>
<p>If you are interested in learning more about Fourier Transform, here is a YouTube video explaining it in more depth:</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/spUNpyF58BY" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<p>Here is a YouTube video explaining the algorithm that actually runs on your computer:</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/h7apO7q16V0" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<p>And here is also a video detailing the history of the development of the Fast Fourier Transform:</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/nmgFG7PUHfo" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<h2 id="heading-final-note">Final Note</h2>
<p>There are more transforms used for signal processing and other purposes, such as the Laplace transform (used in continuous signals) and the Z transform (used in discreet signals).</p>
<p>But, since there are so many mathematical transforms formulas, what really is a transform?</p>
<p>A transform is simply a mathematical tool that helps us see something from a different point of view.</p>
<p>By seeing things a different way, we can learn about details we did not see originally.</p>
<p>For example, with the Fourier Transform, we can see the signal from the point of view of a frequency instead of the point of view of time.</p>
<p>This lets us see the same thing in a different way.</p>
<p>Mathematically, we can say we are changing the domain of the function. In other words, we are changing the x axis.</p>
<p>And I will leave this with you: the Laplace transform is a generalized Fourier transform.</p>
<h3 id="heading-full-code">Full code:</h3>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://github.com/tiagomonteiro0715/Signal-Processing-and-Systems-in-Programming-Guide-for-Beginners">https://github.com/tiagomonteiro0715/Signal-Processing-and-Systems-in-Programming-Guide-for-Beginners</a></div>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ What is Information Systems? Definition for Beginners ]]>
                </title>
                <description>
                    <![CDATA[ You may have heard the term "information systems" as a type of degree some people get from a college or university. Or maybe you've heard it as a general term used to describe information and communication systems in general.  Information systems are... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/what-is-information-systems-definition-for-beginners/</link>
                <guid isPermaLink="false">66adf27288723f64bc4313a9</guid>
                
                    <category>
                        <![CDATA[ Computer Science ]]>
                    </category>
                
                    <category>
                        <![CDATA[ data analysis ]]>
                    </category>
                
                    <category>
                        <![CDATA[ systems ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Kolade Chris ]]>
                </dc:creator>
                <pubDate>Tue, 27 Sep 2022 16:43:54 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/09/christopher-gower-m_HRfLhgABo-unsplash.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>You may have heard the term "information systems" as a type of degree some people get from a college or university. Or maybe you've heard it as a general term used to describe information and communication systems in general. </p>
<p>Information systems are more than a degree or a general term. It is a broad term that describes how data is collected and processed within an organization.  </p>
<p>That’s why I decided to write this article to help you learn what an information system is.</p>
<h2 id="heading-what-is-an-information-system">What is an Information System?</h2>
<p>Information systems (IS) are a group of interrelated components that collect data, process the data, and disseminate the resulting information. This helps support decision-making and other administrative duties within an organization.</p>
<p>If that’s too long for you to digest quickly, you can think about information systems as a network of all communication channels used in an organization. </p>
<p>These communication channels involve:</p>
<ul>
<li>computer <strong>hardware</strong> and <strong>software</strong></li>
<li>the <strong>data</strong> processed by the hardware and software</li>
<li>the <strong>people</strong> in charge of the hardware and software</li>
<li>the <strong>processes</strong> those people undergo to make the hardware and software process data as intended</li>
</ul>
<p>The parts involved in the communication channels described above are the components of an information system. And that’s one of the things we are going to discuss soon in this article.</p>
<h2 id="heading-examples-of-information-systems">Examples of Information Systems</h2>
<p>Modern social media platforms like Twitter and Instagram and reality shows are great but less obvious examples of information systems.  </p>
<p>On those social media platforms:</p>
<ul>
<li>the Twitter or Facebook app and the web version are the software</li>
<li>the computers in Facebook's and Twitter's offices and their data centers are the hardware. The hardware could also involve the devices on which users access those social media platforms </li>
<li>the data is the biodata of users, the tweets and posts, and the engagements they have</li>
<li>the people are the employees of the social media platforms, and possibly the users</li>
<li>the processes are the steps taken to convey the data and the resulting information to the users</li>
</ul>
<p>Another example is a competitive TV reality show. </p>
<ul>
<li>the <strong>people</strong> are the <strong>participants</strong> and the <strong>audience</strong></li>
<li>the <strong>hardware and software</strong> are responsible for capturing the <strong>votes</strong> of the audience</li>
<li>the data is the content of the show</li>
<li>the <strong>processes</strong> is the ways the vote are cast – SMS, an online poll, and others</li>
</ul>
<h2 id="heading-components-of-information-systems">Components of Information Systems</h2>
<p>As we discussed eariler, the components of information systems are <strong>hardware</strong>, software, data, people, and processes. Let’s look at these components one by one.</p>
<h3 id="heading-the-hardware-component-of-information-systems">The Hardware Component of Information Systems</h3>
<p>As you may have learned in school back in the day, hardware is any physical part of the computer that you can see, feel, and more importantly, touch.</p>
<p>But that’s what hardware is to the layperson. As related to information systems, hardware is the equipment and machinery. It's the input and output devices such as keyboard, mouse, system unit, monitor, scanner, printer, and every other part of the computer system.</p>
<h3 id="heading-the-software-component-of-information-systems">The Software Component of Information Systems</h3>
<p>Simply put, the software is what tells the hardware what to do. This software is computer programs you can find in installation disks and executables that you can download from the internet.</p>
<p>However, technology has evolved beyond software being installable files and executables in disks. These days, you get access to software embedded on a website. </p>
<p>For instance, back in the day, we all had to install Photoshop or Coreldraw to make graphic cards and images. Today, you get access to the same thing on canva.com. </p>
<p>Also, designers had to install Adobe XD on their computers, but today, you can use figma.com to design whatever you want. </p>
<h3 id="heading-the-data-component-of-information-systems">The Data Component of Information Systems</h3>
<p>Data is probably the reason why information systems exist. Every other component of information systems revolves around data.</p>
<p>Data is a collection of facts. It could be user data such as name, age, gender, and any other thing you can collect and save in a database. </p>
<p>In its original form, data does nothing. Data becomes useful and powerful when it is interpreted and analyzed. When the interpretation and analysis are done, you don’t have data anymore – what you have is information.</p>
<h3 id="heading-the-people-component-of-information-systems">The People Component of Information Systems</h3>
<p>People are the most important component of an information system. That’s because they are the ones in charge of making the hardware and software process data as they should.</p>
<p>Sometimes, more emphasis is laid on the technological components of information systems than those in charge of it. This should never be the case because, from the lowest to the highest ranked team member, every member of an organization is extremely important. And any organization that fails to invest in its people is bound to fail.</p>
<h3 id="heading-the-processes-component-of-information-system">The Processes Component of Information System</h3>
<p>Also called procedure, the processes component is the steps taken to achieve the desired outcome or an end goal. Just like the software tells the hardware what to do, processes are what tell the people what to do.</p>
<p>In many organizations, automation isn't enough to get a lot of processes done. In fact, some automation can be buggy and might end up taking more time than when you do the same thing manually. That’s one of the reasons why the people component is extremely important.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>In this article, you’ve learned about what information systems are and you've seen some examples. We also discussed all the components of information systems and what they entail.</p>
<p>If you want to read more about information systems, you should check out <a target="_blank" href="https://bus206.pressbooks.com/chapter/chapter-1/">this resource from pressbooks</a> and <a target="_blank" href="https://www.techopedia.com/definition/24142/information-system-is">this short article from techopedia</a>.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Microprocessor's Romance With Negative Integers – The How and Why of CPU Arithmetic Design ]]>
                </title>
                <description>
                    <![CDATA[ By Vivek Agrawal One of the first things we learn about computers is that they only understand 0s and 1s, or bits.  We humans, on the other hand, communicate numbers via the decimal system. This system uses digits from 0 to 9 along with plus and minu... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/microprocessors-romance-with-integers/</link>
                <guid isPermaLink="false">66d461712472e5ed2fa07bc1</guid>
                
                    <category>
                        <![CDATA[ binary ]]>
                    </category>
                
                    <category>
                        <![CDATA[ cpu ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Mathematics ]]>
                    </category>
                
                    <category>
                        <![CDATA[ systems ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Thu, 28 Jan 2021 18:30:45 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/01/cover2.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Vivek Agrawal</p>
<p>One of the first things we learn about computers is that they only understand <strong>0s and 1s</strong>, or <strong>bits</strong>. </p>
<p>We humans, on the other hand, communicate numbers via the decimal system. This system uses digits from 0 to 9 along with plus and minus signs (+ and -) to denote positive or negative numbers. </p>
<p>Since computers can use only two digits – 0 and 1 – engineers and mathematicians back in the day designed clever techniques for representing negative numbers and for doing arithmetic with them. Let's explore the beauty of those techniques.</p>
<h2 id="heading-first-some-background-on-how-computers-work">First, some background on how computers work</h2>
<p>Software, images, text, videos, numbers and everything in between are 0s and 1s at the lowest level in our computer.</p>
<p>For images, text, videos and numbers, we have encoding schemes that decide how these stuff will get to 0s and 1s. For example, ASCII and Unicode for text.</p>
<p>The software programs we code get to 0s and 1s via compilers and assemblers. Those set of 0s and 1s known as machine code (or machine instruction) are first stored in our computer's main memory (RAM) before the processor can execute them.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/01/fetch-decode-exec.png" alt="A diagram showing fetch decode execute cycle" width="600" height="400" loading="lazy">
_The fetch decode execute cycle architected by Sir <a target="_blank" href="https://en.wikipedia.org/wiki/John_von_Neumann">John von Neumann</a>. Every digital computer follows this cycle to run machine code._</p>
<p>The processor starts the execution cycle by <strong>fetching</strong> the instructions from the main memory, then the control unit of the processor <strong>decodes</strong> those instructions into two parts – operation code (opcode) and operands. </p>
<p>The opcode decides the further action that needs to be performed like ADD (addition), JMP (jump), INC (increment) and so on. The operands are the values (or memory locations) on which that operation will be performed. </p>
<p>The decoded instructions are sent to the Arithmetic and Logic Unit (ALU) for <strong>execution</strong>. In the ALU, the instruction is executed based on the opcode on the operands and the result is stored back in the memory. </p>
<p>For example, the assembly code <code>ADD eax, 42</code> is first turned into machine code (0s and 1s) by the assembler. Then it is stored into the main memory before the fetch-decode-execute cycle can begin. </p>
<p>When the fetching of the machine code for <code>ADD eax, 42</code> from the memory finishes, the instruction is decoded. The decoded output says that the opcode is <code>ADD</code> and the operands are <code>eax</code> and <code>42</code>.  </p>
<p><code>eax</code> is a register – a memory location inbuilt into the processor that can be accessed instantaneously by the processor. The <code>eax</code> register is called an accumulator in most processors. </p>
<p>The <code>ADD eax, 42</code> assembly code is designed to add 42 to the current value of the <code>eax</code> register (accumulator) and stores that sum in <code>eax</code>. It is <code>eax = eax + 42</code>. </p>
<p>Suppose that currently <code>eax</code> is 20. This means that the value of <code>eax</code> after executing <code>ADD eax, 42</code> will be 20 + 42 = 62.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/01/Edvac-1.jpg" alt="Two men operating EDVAC computer" width="600" height="400" loading="lazy">
<em>EDVAC was one of the earliest electronic binary computer built for the U.S. Army's Ballistics Research Laboratory. (<a target="_blank" href="https://en.wikipedia.org/wiki/EDVAC#/media/File:Edvac.jpg">Image source</a>, Public Domain).</em></p>
<p>The design of early computers such as EDVAC started with the desire to make tedious mathematical calculations easier and faster. </p>
<p>The whole responsibility of making computers compute lay on the shoulders of adders – circuits that add two numbers. This is because sophisticated operations like subtraction, multiplication, and division utilize adders in their circuits.  </p>
<p>Ultimately computers are just a fast arithmetic machines with logic capabilities. Understanding the challenges and the beauty of binary arithmetic design (of positive and especially negative integers) is <strong>one of the most fundamental concepts in a computer processor</strong>. </p>
<p>Let's first see how decimal numbers are represented in binary and how to add two binary values. Then we will start exploring the beauty.      </p>
<h2 id="heading-how-the-binary-system-works">How the binary system works</h2>
<p>If I tell you to read out <code>872500</code>, you will likely say <strong>872.5K</strong>. Let's take a look at how our minds do this.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/01/decimal_sys_img-2.png" alt="The procedure we humans use to read decimal numbers" width="600" height="400" loading="lazy"></p>
<p>We assign the one's place to the first digit from the right, then the ten's place to the second from the right, the hundredths to the third, and so on, growing each time by power of 10. </p>
<p>These powers of 10 in each place are the weights of the places. The weight of the hundredth place is one hundred. We multiply the digits in each place by their place's weight and sum them all up to get a complete number.</p>
<p>In the above diagram, you can see that the growth of each place's weight is in the powers of 10, starting from <code>10^0</code> and going through <code>10^5</code>. That's why decimals are called a base ten system.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/01/binary_sys_img-2.png" alt="The procedure via which computers read binary codes" width="600" height="400" loading="lazy"></p>
<p>In binary, each place's weight grows by a power of 2. This means that the place's weight starts from <code>2^0</code> and ends at <code>2^something</code>. That's the only difference.</p>
<p><code>00110101</code> in decimal translates to 53. Computers interpret binary in the same way as we humans interpret decimals, that is multiplying each place's digit by its weight and summing them up.</p>
<h3 id="heading-how-to-add-1s-and-0s">How to add 1s and 0s</h3>
<p>Addition works in binary pretty much the same way as it's done in decimals. Let's see that through an example. We'll add two binary numbers: <code>1101</code> (13) and <code>1100</code> (12).</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/01/1-1.png" alt="Step one of addition of 1101 and 1100 that is one plus zero" width="600" height="400" loading="lazy"></p>
<p>As we do in the decimal system, we start from the one's place (<code>2^0</code>). Adding 1 and 0 gives us 1. So we put a 1 there. Stay with me and you'll get the whole picture.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/01/2-1.png" alt="Step two of addition of 1101 and 1100 that is zero plus zero" width="600" height="400" loading="lazy"></p>
<p>0 plus 0 is 0. Moving on.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/01/3-2.png" alt="Step three of addition of 1101 and 1100 that is one plus one" width="600" height="400" loading="lazy"></p>
<p>1 plus 1 is 2. And 2 in binary is represented as <code>10</code>. We carry 1 to the next place and keep 0 as a result of the current place we are in. Isn't this the same as exceeding 9 in a place in decimal addition? </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/01/4-1.png" alt="Step four of addition of 1101 and 1100 that is one plus one plus one of carry row" width="600" height="400" loading="lazy"></p>
<p>We have two 1s there and one 1 that was carried forward from the previous place, so there are a total of three 1s. Their sum will be 3, and in binary 3 is <code>11</code> so we write <code>11</code>. The final result comes out to be <code>11001</code> or 25 in decimal form, which is indeed 13 + 12.</p>
<p>The above computation assumes that we have five bits available to store the result. If a 4-bit computer does this addition, then it will only have four bits available to store the result. </p>
<p>That fifth bit will be called an <strong>overflow</strong> in 4-bit computers. In integer arithmetic, the overflow bit is ignored or discarded. So we would have got <code>1001</code> (9) as our result if we were using a 4-bit computer.</p>
<h2 id="heading-the-beauty-of-binary-arithmetic-design">The beauty of binary arithmetic design</h2>
<p>Two important terms we need to understand before we move forward are <strong>least significant bit</strong> and <strong>most significant bit</strong>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/01/lsb_msb-1.png" alt="The least significant and the most significant bit in a byte word" width="600" height="400" loading="lazy"></p>
<p>The bit on the <strong>rightmost is the least significant bit</strong> because it has the smallest place weight (<code>2^0</code>). And the bit on the <strong>leftmost is the most significant bit</strong> as it has the highest place weight (<code>2^7</code>).</p>
<p>If the world only had positive numbers, then this would have been the end of this article (because we have already learned how to represent decimals in binary and how to add them in binary). </p>
<p>Thankfully, we have negative numbers, too. </p>
<p>The beauty of the CPU's arithmetic design rests in negativeness. </p>
<p>So how do computers represent negative numbers, and how does arithmetic on negative numbers work? Let's see an encoding approach to this problem.</p>
<p>Please note that in the below sections we will be working with a 4-bit computer to understand the concepts, meaning the fifth bit will be treated as an overflow. The same principles apply to all the CPU architectures like 16-bit, 32-bit or 64-bit to do arithmetic.</p>
<h3 id="heading-the-sign-magnitude-encoding-approach">The sign magnitude encoding approach</h3>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/01/sign-bit01-1.png" alt="The leftmost bit in a four bit binary is the sign bit and the remaining three represents magnitude" width="600" height="400" loading="lazy"></p>
<p><code>1101</code> in decimal form would be -5 in this encoding scheme. The leftmost or the most significant bit is the sign bit. It tells the processor about the sign of the number – that is, whether the number is positive or negative. </p>
<p><code>0</code> in the sign bit represents a positive value and <code>1</code> represents a negative value. The remaining bits tells us the actual magnitude.</p>
<p>In <code>1101</code>, the sign bit is <code>1</code>, so the number is negative. <code>101</code> equals 5 in decimal. So <code>1101</code> will compute to -5 in decimal.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/01/4bit-1.png" alt="All numbers that are possible with four bits using sign bit encoding scheme" width="600" height="400" loading="lazy">
<em>All possible numbers that can be represented by four bits with sign bit encoding scheme</em></p>
<p>In the above diagram you can see all the integers that can be represented by four bits using this encoding approach. All looks good up to this point. </p>
<p>But if we look closely, we can see a very serious design issue in this encoding scheme. Let's face that issue.</p>
<p>Let's add a positive and a negative number. For example we'll add +4 and -1. Our answer should be <code>(+4) + (-1) = (+3)</code> that is <code>0011</code>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/01/signbitproblem.png" alt="Adding +4 and -1 in binary resulting in -5 when using sign bit encoding scheme" width="600" height="400" loading="lazy"></p>
<p>See, the result is <code>1101</code> (-5). The actual answer should be <code>0011</code> (+3). If we were to implement this approach on a processor then we would need to add logic to deal with this issue, and engineers hate additional complexity in their logic. </p>
<p>As we add more circuits, the power consumption increases and performance suffers. </p>
<p>This might sound like a trivial issue for modern transistor-based computers. </p>
<p>But think of early computers like EDVAC which was run on thousands of vacuum tubes consuming power in kilowatts operated by hundreds of people a day. And the government spent millions to build them. </p>
<p>In those days putting additional circuits and vacuum tubes meant thousands of dollars and serious maintenance trouble.   </p>
<p>So engineers had to think of a smarter encoding design. </p>
<p>Now, the time has come to reveal the beauty that will tackle this problem and make our system simpler, more performant, and less power hungry.</p>
<h3 id="heading-a-beautiful-encoding-system-enters-and-the-cpu-shines">A beautiful encoding system enters and the CPU shines ❤️</h3>
<p>In this encoding scheme, like in the previous one, the leftmost bit acts as a sign bit – but with some art involved to represent negative numbers.</p>
<p>The positive numbers are represented in the exact same way as the previous encoding scheme: a leading <code>0</code> followed by remaining bits for the magnitude. For example, in this encoding scheme too, 6 will be represented as <code>0110</code>. </p>
<p>To represent a negative number, a two step math process is run in its positive counterpart. Meaning to represent -6 we will do a two step math process on +6 to get to -6 in binary. </p>
<p>Let's see how -6 will encode to binary:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/01/invert-1.png" alt="An illustration of bits getting inverted" width="600" height="400" loading="lazy"></p>
<p>In the previous sign magnitude approach, to calculate the negative of +6, we would have simply changed the sign bit from <code>0</code> to <code>1</code>. <code>0110</code> (+6) would become <code>1110</code> (-6).</p>
<p>In this new encoding scheme, we first invert the bits. Changing zeros to ones and ones to zeros. <code>0110</code> (+6) becomes <code>1001</code>. Inverting the bits is called "one's complement", so here we have calculated one's complement of <code>0110</code> resulting in <code>1001</code>. Then...</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/01/-6-1.png" alt="Adding binary one to 1001, resulting in 1001" width="600" height="400" loading="lazy"></p>
<p>We add <code>0001</code> (+1) to the one's complement we got from step one (<code>1001</code>). The result <strong><code>1010</code> will be the binary representation of -6. This encoding scheme is called two's complement.</strong> So keep in mind that calculating two's complement of a positive integer gives us its negative counterpart.  </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/01/twocomplementshort-4.png" alt="Steps of calculation of the two's complement of 0110" width="600" height="400" loading="lazy"></p>
<p>Inverting bits gives us the one's complement. Adding one to the one's complement gives us the two's complement of the original bits we started with. Simple, right?</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/01/2complement.png" alt="All possible numbers that can be represented by four bits with two's complement encoding scheme" width="600" height="400" loading="lazy">
<em>All possible numbers that can be represented by four bits with two's complement encoding scheme</em></p>
<p>Now, let's see why this encoding scheme is so beautiful. We'll add <code>0100</code> (+4) and <code>1111</code> (-1).</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/01/2complesolution.png" alt="Addition of 0100 and 1111 when using two's complement encoding scheme" width="600" height="400" loading="lazy"></p>
<p>See, we get the accurate result with the two's complement encoding scheme. Now we can add integers without worrying about their signs. </p>
<p>We've learned how a negative integer can be represented in 0s and 1s via two's complement encoding. Now suppose we execute <code>ADD eax, -3</code> and the current value in the eax register is -1. So the value in eax after the execution of <code>ADD eax, -3</code> will be -4 (which is <code>1100</code> in two's complement encoding). </p>
<p>When the operating system retrieves <code>1100</code> from eax to present the result to the user, how does the operating system decode <code>1100</code> to decimal? Or suppose if we as a programmer come across <code>1100</code>, how can we figure out what number <code>1100</code> represents? </p>
<p>Of course we cannot keep on calculating two's complement of each positive integer to see when we hit <code>1100</code>. That will be too slow.   </p>
<p>Programmers and the OS use a beautiful property of two's complement to decode the binary into decimal. </p>
<p>When we calculate two's complement of a positive number, we get its negative counterpart. Well, <strong>the reverse is also true</strong> – which means calculating two's complement of a negative number will give us its positive counterpart. We will see the why of this in a minute. </p>
<p>First, let's understand how the OS or a programmer will decode <code>1100</code> to decimal.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/01/2complementexample-1.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>On retrieving <code>1100</code> from the eax register, the OS sees <code>1</code> as sign bit that signals that the integer is negative. Two's complement of <code>1100</code> is calculated that gives the positive counterpart of <code>1100</code> which comes out as <code>0100</code> (+4). The OS then prepends a negative sign on the positive counterpart and returns the final answer as -4. Re-read this paragraph once again and you'll get a better understanding.</p>
<p>Then the CPU smiles and says goodbye to the beauty for today ;) </p>
<p>The CPU has gone to its house to meet its mother. Now we have plenty of time to discuss the inner workings of the art of two's complement.</p>
<h2 id="heading-why-and-how-does-twos-complement-encoding-work">Why and how does two's complement encoding work?</h2>
<p>If I tell you to find the negative of a number, say +42, what's the simplest way to find the negative of +42? </p>
<p>Arguably, the simplest way is to subtract the number from 0, right? <code>0 - (+42) = -42</code>. If we repeat this, we get back to the positive value, <code>0 - (-42) = +42</code>. This is all the math that two's complement is built upon.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/01/zerominusnum-1.png" alt="Subtracting 0101 from 10000 resulting in 1011" width="600" height="400" loading="lazy"></p>
<p>We are doing <code>10000</code> (0 in decimal since the leftmost 1 is an overflow) minus <code>0101</code> (+5). We get <code>1011</code> that is -5 in decimal in two's complement encoding. Ignore how subtraction is done. That's not important. Understanding the intuition behind two's complement is important.</p>
<p><code>10000</code> can be written as <code>1111 + 0001</code> (try adding these two, you will get <code>10000</code>). So actually we are doing:</p>
<pre><code>        <span class="hljs-number">10000</span>       -   <span class="hljs-number">0101</span>
=&gt;  (<span class="hljs-number">1111</span> + <span class="hljs-number">0001</span>)   -   <span class="hljs-number">0101</span>
</code></pre><p>Rearranging the above equation we can write it as:</p>
<pre><code>    (<span class="hljs-number">1111</span> + <span class="hljs-number">0001</span>)  -  <span class="hljs-number">0101</span>
=&gt;  (<span class="hljs-number">1111</span> - <span class="hljs-number">0101</span>)  +  <span class="hljs-number">0001</span>

Step <span class="hljs-number">1</span>: subtract <span class="hljs-number">0101</span> <span class="hljs-keyword">from</span> <span class="hljs-number">1111</span>

        <span class="hljs-number">1</span> <span class="hljs-number">1</span> <span class="hljs-number">1</span> <span class="hljs-number">1</span>
       <span class="hljs-number">-0</span> <span class="hljs-number">1</span> <span class="hljs-number">0</span> <span class="hljs-number">1</span>
       ---------
        <span class="hljs-number">1</span> <span class="hljs-number">0</span> <span class="hljs-number">1</span> <span class="hljs-number">0</span>

       see, subtracting <span class="hljs-number">0101</span> <span class="hljs-keyword">from</span> <span class="hljs-number">1111</span> is equivalent 
       to inverting the bits <span class="hljs-keyword">of</span> <span class="hljs-number">0101</span>, <span class="hljs-keyword">as</span> we got <span class="hljs-number">1010</span> <span class="hljs-keyword">as</span> a result. 



Step <span class="hljs-number">2</span>: add <span class="hljs-number">0001</span> to the above result  

        <span class="hljs-number">1</span> <span class="hljs-number">0</span> <span class="hljs-number">1</span> <span class="hljs-number">0</span>  ---&gt; result <span class="hljs-keyword">of</span> step <span class="hljs-number">1</span>
       +<span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">1</span>
       ---------
        <span class="hljs-number">1</span> <span class="hljs-number">0</span> <span class="hljs-number">1</span> <span class="hljs-number">1</span>      

       we get <span class="hljs-number">1011</span> that is <span class="hljs-number">-5</span> <span class="hljs-keyword">in</span> two<span class="hljs-string">'s complement encoding.</span>
</code></pre><p>Did you see that the two's complement system fundamentally does 0 minus the number? Inverting the bits and adding one is a fast and clever way to subtract the number from 0. </p>
<p>This is the reason we get the positive of a negative number and negative of a positive number when we calculate its two's complement – because we are actually subtracting the number from 0 (<code>0 - number</code>). </p>
<p>Computers in the 1900s used to have just the addition arithmetic logic because the two's complement encoding scheme is so beautiful that subtraction can easily be performed. </p>
<p>For example, to subtract 12 from 100, the CPU computes two's complement of +12 that produces -12 then we add -12 to 100 giving us the required output.  </p>
<p>Why don't we directly subtract from 0 to find the negative of a number or vice versa in binary? </p>
<p>Because subtraction is a slow and complicated process (thanks to borrowing) so our computer will need an expensive subtraction circuit if we go that way. Imagine subtracting from 0 every time we want to represent a negative integer. It'll be a nightmare for us and for our computers as well!</p>
<p>The two's complement encoding is a more performant solution, leads to a simple circuit design, and saves a lot of money. This is because we don't need an expensive circuit for subtraction and there's no additional logic to deal with the arithmetic of + and - integers. Just plain addition and we get to do both – add and subtract. </p>
<p>So let's appreciate our computer designers for this beautiful encoding scheme – <strong>the two's complement ❤️.</strong>  </p>
<h2 id="heading-final-words">Final words</h2>
<p>I promised myself that I would never charge for any learning material I produce. Whatever I do for education, whether it be a simple article or a course or an ebook, will always be 100% free and open. </p>
<p>I post useful resources and share meaningful thoughts on <a target="_blank" href="https://twitter.com/vkwebdev">my Twitter account</a>. You can follow me there and send me a DM if you learned something new from this article. It'll make my day :)</p>
<p>Every developer, every author, and every human being learns from someone. I believe the people and resources we learn from should be cited and spread. This encourages those good ones to do more for all of us. So here are my good ones.</p>
<p><a target="_blank" href="https://www.youtube.com/watch?v=zxb8DvLUqcM">Animesh of mycodeschool</a> taught me many programming concepts better than anyone else including the concepts I wrote about in this article.</p>
<p><a target="_blank" href="https://jaenis.ch/">André Jaenisch</a>, my mentor and friend, without his reviewing efforts and constant support I would not have written this article.</p>
<p>Happy learning!</p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
