<?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[ hardware - 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[ hardware - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Wed, 27 May 2026 20:46:58 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/hardware/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ From Pixels to Predictions: How GPUs Started Powering Modern AI ]]>
                </title>
                <description>
                    <![CDATA[ When people think of artificial intelligence, they imagine complex models, data centers, and cloud servers. What most don’t realize is that the real engine behind this AI revolution started in a place few expected: inside the humble gaming PC. The sa... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/from-pixels-to-predictions-how-gpus-started-powering-modern-ai/</link>
                <guid isPermaLink="false">69164b0a612455db63b30bdc</guid>
                
                    <category>
                        <![CDATA[ AI ]]>
                    </category>
                
                    <category>
                        <![CDATA[ GPU ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Games ]]>
                    </category>
                
                    <category>
                        <![CDATA[ hardware ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Manish Shivanandhan ]]>
                </dc:creator>
                <pubDate>Thu, 13 Nov 2025 21:18:02 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1763068628238/531621b6-1931-422f-b8ff-455c1ef58dab.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>When people think of artificial intelligence, they imagine complex models, data centers, and cloud servers.</p>
<p>What most don’t realize is that the real engine behind this AI revolution started in a place few expected: inside the humble gaming PC.</p>
<p>The same graphics cards once built to render smooth 3D visuals are now powering chatbots, image generators, and self-driving systems. The journey from pixels to predictions is one of the most fascinating stories in modern computing.</p>
<h2 id="heading-the-cpu-era-and-its-limits"><strong>The CPU Era and Its Limits</strong></h2>
<p>In the early days of machine learning, researchers depended on CPUs to crunch data.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1762950299566/a8c9ea6a-f420-4f9e-b87c-5b584be5166a.png" alt="CPU architecture" class="image--center mx-auto" width="1000" height="500" loading="lazy"></p>
<p>CPUs were versatile and great for handling a wide range of tasks, but they had one big limitation: they worked on problems in sequence.</p>
<p>That means they could process only a few operations at a time. For small models, this was fine. But as neural networks grew in complexity, training them on CPUs became painfully slow.</p>
<p>Imagine trying to teach a computer to recognize images. A neural network might have millions of parameters, and every single one needs to be adjusted again and again during training.</p>
<p>On CPUs, that could take days or even weeks. Researchers quickly realized that if AI was going to advance, it needed a completely different kind of hardware.</p>
<h2 id="heading-how-gpus-entered-the-picture"><strong>How GPUs Entered the Picture</strong></h2>
<p><a target="_blank" href="https://aws.amazon.com/what-is/gpu/">Graphics processing units</a>, or GPUs, were originally built to render the fast-moving images in video games. They were designed for parallelism, performing thousands of small calculations at the same time.</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/Axd50ew4pco" 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> </p>
<p>While a CPU might have a handful of cores, a GPU has thousands. This architecture made GPUs ideal for the kind of math used in machine learning, where the same operation needs to be applied to huge amounts of data simultaneously.</p>
<p>In a way, the GPU was built for games but destined for AI. What started as a chip to make lighting effects smoother and explosions look more realistic soon found a second life powering neural networks.</p>
<p>Around the early 2010s, researchers began experimenting with running <a target="_blank" href="https://www.freecodecamp.org/news/deep-learning-fundamentals-handbook-start-a-career-in-ai/">deep learning algorithms</a> on GPUs, and the results were stunning. Training times dropped from weeks to days, and accuracy improved.</p>
<p>It was a quiet revolution happening in research labs around the world.</p>
<h2 id="heading-the-role-of-gaming-pcs-in-early-ai-research"><strong>The Role of Gaming PCs in Early AI Research</strong></h2>
<p>Here’s where the story gets even more interesting: many of the early breakthroughs in AI didn’t come from massive data centres or expensive supercomputers. They came from researchers using consumer-grade GPUs, often sitting inside regular gaming PCs.</p>
<p>These machines, built for entertainment, turned out to be powerful enough for deep learning experiments.</p>
<p><a target="_blank" href="https://en.wikipedia.org/wiki/CUDA">NVIDIA’s CUDA</a> platform made this possible by allowing developers to program GPUs for tasks beyond graphics. Suddenly, a gaming GPU could handle complex scientific computations.</p>
<p>Researchers used their own rigs, sometimes the same computers they played games on at night, to train neural networks that recognized speech, images, and text. The gaming PC became a testbed for the future of artificial intelligence.</p>
<h2 id="heading-the-turning-point-alexnet-and-the-deep-learning-boom"><strong>The Turning Point: AlexNet and the Deep Learning Boom</strong></h2>
<p>In 2012, a neural network called <a target="_blank" href="https://www.pinecone.io/learn/series/image-search/imagenet/">AlexNet</a> stunned the world by winning the ImageNet competition, a major benchmark in computer vision.</p>
<p>What made AlexNet special wasn’t just its architecture but the hardware behind it. It ran on two NVIDIA GTX 580 GPUs, hardware you could buy for your <a target="_blank" href="https://www.eneba.com/hub/gaming-gear/best-gaming-pc-under-1000/">low-cost gaming PC</a>. That win marked a turning point. It proved that GPUs weren’t just for rendering graphics – they were the key to advancing AI.</p>
<p>After that, the AI world changed fast. Every major research lab and tech company started building GPU clusters. NVIDIA, sensing the opportunity, leaned into AI hardware development.</p>
<p>The same company that once catered mainly to gamers now powered Google, OpenAI, and Tesla. What started as a tool for better visuals had become the backbone of machine intelligence.</p>
<h2 id="heading-why-gpus-are-so-good-at-ai"><strong>Why GPUs Are So Good at AI</strong></h2>
<p>GPUs excel at matrix math, the kind of computation that neural networks rely on.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1763135976807/adcb3ce6-40e0-4bb2-b138-7f9208b4a6b4.jpeg" alt="matrix math" class="image--center mx-auto" width="1000" height="271" loading="lazy"></p>
<p>When you train a model, you’re constantly multiplying and adding matrices of numbers. GPUs do this faster because they handle thousands of operations in parallel. They’re also designed with high memory bandwidth, meaning they can move large amounts of data in and out quickly.</p>
<p>This architecture fits perfectly with deep learning workloads. Whether it’s image recognition or language translation, GPUs can process huge batches of data at once.</p>
<p>CPUs, by contrast, get bottlenecked by sequential processing. The difference in performance is like comparing a single craftsman building a house to a team of thousands working at once.</p>
<h2 id="heading-the-ai-hardware-race"><strong>The AI Hardware Race</strong></h2>
<p>As AI took off, the demand for GPUs exploded. What began in gaming PCs scaled up into massive data centers filled with thousands of cards.</p>
<p>Companies like NVIDIA developed new lines of GPUs specifically for AI, such as the Tesla and A100 series. Other players joined the race too, like AMD with its <a target="_blank" href="https://www.amd.com/en/products/software/rocm.html">ROCm platform</a>, and Google with its custom TPUs (Tensor Processing Units).</p>
<p>Yet, even today, the line between gaming and AI hardware remains blurred. The same RTX GPUs designed for gamers are still used by many AI researchers and small startups.</p>
<p>A powerful gaming PC equipped with a modern GPU can run local AI models, generate images, or even fine-tune small language models. The hardware that made virtual worlds come alive now brings intelligence to our real one.</p>
<h2 id="heading-the-future-of-gpus-and-ai"><strong>The Future of GPUs and AI</strong></h2>
<p>As AI models grow larger, new challenges are emerging. GPUs are evolving to handle trillion-parameter models, but they’re also getting smarter about energy use and efficiency.</p>
<p>Technologies like chiplet design, optical interconnects, and AI-specific cores are pushing performance further while keeping costs down.</p>
<p>Meanwhile, local AI is making a comeback. With advancements in GPU efficiency, many users are experimenting with running models on their own machines.</p>
<p>A well-equipped gaming PC can now do what once required access to a cloud GPU cluster. This shift could democratize AI development, letting anyone with the right hardware explore the field from home.</p>
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<p>The GPU’s journey from gaming to AI is one of the most unexpected transformations in tech history. What started as a chip to render virtual landscapes evolved into the heart of artificial intelligence. From early experiments on gaming PCs to the data centers powering today’s largest models, GPUs have bridged the worlds of creativity, computation, and cognition.</p>
<p>As we look ahead, it’s clear that the same technology that once made games more realistic is now making machines more intelligent. The story of the GPU reminds us that innovation often comes from unexpected places, and sometimes, the future of AI begins in the glow of a gaming screen.</p>
<p><em>Hope you enjoyed this article. Find me on</em> <a target="_blank" href="https://linkedin.com/in/manishmshiva"><em>Linkedin</em></a> <em>or</em> <a target="_blank" href="https://manishshivanandhan.com/"><em>visit my website</em></a><em>.</em></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Connect, Read, and Process Sensor Data on Microcontrollers – A Beginner's Guide ]]>
                </title>
                <description>
                    <![CDATA[ In today’s world, computers are ubiquitous and generally serve two primary purposes. The first is general-purpose computing, where they handle a wide range of tasks, including running diverse applications and programs. Examples include laptops, deskt... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/connect-read-process-sensor-data-on-microcontrollers-for-beginners/</link>
                <guid isPermaLink="false">67d45997c9e7f2d42bb1c540</guid>
                
                    <category>
                        <![CDATA[ embedded systems ]]>
                    </category>
                
                    <category>
                        <![CDATA[ microcontroller ]]>
                    </category>
                
                    <category>
                        <![CDATA[ embedded software ]]>
                    </category>
                
                    <category>
                        <![CDATA[ ADC ]]>
                    </category>
                
                    <category>
                        <![CDATA[ I2C ]]>
                    </category>
                
                    <category>
                        <![CDATA[ real-time data processing ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Signal Processing ]]>
                    </category>
                
                    <category>
                        <![CDATA[ sensors ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Electronics ]]>
                    </category>
                
                    <category>
                        <![CDATA[ hardware ]]>
                    </category>
                
                    <category>
                        <![CDATA[ electrical engineering ]]>
                    </category>
                
                    <category>
                        <![CDATA[ software architecture ]]>
                    </category>
                
                    <category>
                        <![CDATA[ MathJax ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Soham Banerjee ]]>
                </dc:creator>
                <pubDate>Fri, 14 Mar 2025 16:30:15 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1741902732575/fd41a2d5-ed4f-445d-b186-936625837c8d.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>In today’s world, computers are ubiquitous and generally serve two primary purposes.</p>
<p>The first is general-purpose computing, where they handle a wide range of tasks, including running diverse applications and programs. Examples include laptops, desktops, servers, and supercomputers.</p>
<p>The second is embedded systems, which are specialized computers designed for specific functions. Commonly found in devices such as thermostats, refrigerators, cars, and other smart appliances, they rely on sensors to collect environmental data and execute their tasks efficiently.</p>
<h3 id="heading-the-role-of-sensors"><strong>The Role of Sensors</strong></h3>
<p>Sensors play a critical role in both types of computing. In embedded systems, sensors gather environmental data to help devices like autonomous vehicles, home appliances, and industrial machines perform tasks. In general-purpose computers, sensors primarily monitor internal conditions such as temperature and voltage, ensuring safe operation and preventing issues like overheating or electrical faults.</p>
<p>As Artificial Intelligence (AI) and the Internet of Things (IoT) evolve, sensors have become indispensable for gathering real-world data to support intelligent decision-making. Embedded systems leverage sensors to perceive their environment, transforming raw data into actionable insights that power automation and improve efficiency across industries.</p>
<p>This means that understanding sensor interfacing and designing robust sensor-driven software has become a vital skill for engineers and hobbyists alike.</p>
<p>Whether you're a beginner or experienced engineer, this guide will help you build a solid understanding of sensor interfacing software.</p>
<h2 id="heading-what-youll-learn-and-article-scope"><strong>What You’ll Learn and Article Scope</strong></h2>
<p>In this article, you’ll learn how to connect sensors to microcontrollers (MCUs) and design sensor software pipelines that turn raw data into meaningful, usable information. You’ll also explore practical techniques for processing sensor data accurately and efficiently in embedded systems.</p>
<p>Here’s a breakdown of what we’ll cover:</p>
<ul>
<li><p>What sensors are and how they work – An introduction to sensors, common types, and how sensor pipelines help process sensor data.</p>
</li>
<li><p>Key sensor characteristics – Important parameters like sensitivity, accuracy, precision, range, drift, and response time to help you choose the right sensor for your project.</p>
</li>
<li><p>How to interface sensors with microcontrollers – Hardware connections and communication protocols like SPI, I²C, and GPIO that allow microcontrollers to read sensor data.</p>
</li>
<li><p>Software architecture for sensor data – A high-level overview of the software pipeline that processes sensor data, including drivers, ADC support, scaling, calibration, and post-processing.</p>
</li>
<li><p>Detailed design of pipeline components – A closer look at each step in the pipeline, focusing on scaling raw data, calibrating sensors, and applying filters to clean up noisy signals.</p>
</li>
<li><p>Practical tips for power management – Best practices for handling power efficiently using low-power modes, FIFO buffers, and DMA when working with sensor data in embedded systems.</p>
</li>
</ul>
<p>By the end of this article, you’ll know how to design and implement a complete sensor data pipeline for an embedded system, from reading raw sensor data to preparing it for real-world use in intelligent, connected devices.</p>
<p><strong>Note</strong>: Advanced data processing, high-resolution ADCs, and hardware circuit design for sensors are outside the scope of this article.</p>
<h2 id="heading-prerequisites"><strong>Prerequisites</strong></h2>
<p>To get the most out of this article, you should have:</p>
<ol>
<li><p>Basic knowledge of microcontrollers: Understanding of common peripherals like ADCs (Analog-to-Digital Converters), SPI (Serial Peripheral Interface), I2C (Inter-Integrated Circuit) and GPIO (General Purpose Input/Output). If you’re new to these protocols, <a target="_blank" href="https://www.parlezvoustech.com/en/comparaison-protocoles-communication-i2c-spi-uart/">this article provides a great overview</a>.</p>
</li>
<li><p>Basic knowledge of electronics: Familiarity with circuits and signals, including analog and digital interfaces.</p>
</li>
<li><p>Programming in C: Familiarity in embedded software development, including driver development.</p>
</li>
<li><p>(Optional) Basic knowledge of sensors: Understanding different types of sensors (like temperature, pressure, motion) is helpful but not required.</p>
</li>
</ol>
<p>Also, this article assumes the following:</p>
<ul>
<li><p>You are working with a microcontroller equipped with the peripherals needed for sensor integration. The details of microcontroller peripherals can be found in a <a target="_blank" href="https://pdf.xab3.ro/manual/reference-manual-for-stm32f405415-stm32f407417-stm32f427437-and-stm32f429439-mcus-100">reference manual for example for an STM32F4</a> series microcontroller will have all the details :</p>
</li>
<li><p>You are familiar with compilers, debuggers, and IDEs used in embedded systems. Some common tools include:</p>
<ul>
<li><p>Compilers: <a target="_blank" href="https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads">GCC</a>, <a target="_blank" href="https://developer.arm.com/documentation/dui0773/l/Introducing-the-Toolchain/Toolchain-overview?lang=en">Clang</a>,</p>
</li>
<li><p>Debuggers: <a target="_blank" href="https://sourceware.org/gdb/">GDB</a>, <a target="_blank" href="https://lldb.llvm.org/use/tutorial.html">LLDB</a></p>
</li>
<li><p>IDEs: <a target="_blank" href="https://code.visualstudio.com">Visual Studio Code</a> (VSCode) is a popular choice, especially with extensions for embedded development and debugging.</p>
</li>
</ul>
</li>
<li><p>You aim to build reliable, sensor-driven embedded systems, capable of collecting and processing real-world data efficiently.</p>
</li>
</ul>
<h2 id="heading-table-of-contents">Table of Contents</h2>
<ul>
<li><p><a class="post-section-overview" href="#heading-what-is-a-sensor-and-sensor-pipeline">What is a Sensor and Sensor Pipeline?</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-sensor-characteristics">Sensor Characteristics</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-how-to-interface-with-a-microcontroller">How to Interface with a Microcontroller</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-software-architecture">Software Architecture</a></p>
<ul>
<li><p><a class="post-section-overview" href="#heading-high-level-overview-of-components">High-Level Overview of Components</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-accessing-data-from-the-sensor">Accessing Data from the Sensor</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-sensor-power-management">Sensor Power Management</a></p>
</li>
</ul>
</li>
<li><p><a class="post-section-overview" href="#heading-detailed-design-of-components">Detailed Design of Components</a></p>
<ul>
<li><p><a class="post-section-overview" href="#heading-1-sensor-driver">1. Sensor Driver</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-2-adc-support">2. ADC Support</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-3-scaling">3. Scaling</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-4-calibration">4. Calibration</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-5-data-post-processing">5. Data Post-Processing</a></p>
</li>
</ul>
</li>
<li><p><a class="post-section-overview" href="#heading-conclusion">Conclusion</a></p>
</li>
</ul>
<h2 id="heading-what-is-a-sensor-and-sensor-pipeline"><strong>What is a Sensor and Sensor Pipeline?</strong></h2>
<p>A sensor detects changes in physical properties such as temperature, pressure, or light and converts them into electrical signals that can be measured or interpreted. For example, a thermistor is a type of resistor whose resistance changes with temperature. As the temperature varies, the resistance of the thermistor changes, altering the voltage across it. The system then interprets this voltage change to determine the temperature.</p>
<p>To better understand sensors, consider the natural sensors in the human body: the eyes, ears, skin, nose, and tongue. These natural sensors constantly send signals about the environment to the brain for processing. Different regions of the brain interpret these signals and use the information to drive actions and responses. Just like the brain processes signals from natural sensors, a microcontroller processes signals from electronic sensors using a sensor pipeline.</p>
<p>Sensors come in many types, each designed to detect specific physical properties. Some sensors have a sensing element that changes its properties in response to conditions like heat, light, or pressure. Examples include thermistors, infrared receivers, and photodiodes.</p>
<p>For detecting movement, such as acceleration and rotation, MEMS (Microelectromechanical Systems) sensors—like accelerometers and gyroscopes—are widely used.</p>
<p>To measure distance, sensors like sonars, ultrasonic sensors, and radars are common. These are just a few examples of the many types of sensors available.</p>
<p>Beyond the types of physical properties they detect, sensors also differ in their levels of integration. Some sensors are raw sensors, consisting only of a sensing element and a transducer with simple leads for direct connection to an external circuit.</p>
<p>Others, known as smart sensors, include additional components such as an ADC (analog-to-digital converter) and onboard processing capabilities, enabling them to handle more of the data processing independently.</p>
<p>The choice between a raw sensor and a smart sensor depends on your application requirements, including factors like cost, size, and the processing load on the interfacing microcontroller.</p>
<p>Returning to our human analogy, consider how vision works as a sensor pipeline. When light enters our eyes, photoreceptor cells (rods and cones) in the retina act as sensing elements, converting the light into electrical signals. These signals travel via the optic nerve to the brain’s visual cortex, where they undergo processing to form a recognizable image. The brain then interprets this information and initiates a response, like smiling when you see a beautiful scenery.</p>
<p>Similarly, a sensor pipeline for an embedded system can be defined as shown in the picture below:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1738828676916/75137176-c9ba-432d-bf44-bb3da093e18d.png" alt="Figure 1: A Sensor Pipeline showing analogue to digital conversion, calibration, filtering, and then processing." class="image--center mx-auto" width="600" height="400" loading="lazy"></p>
<p>Each of these steps may have different requirements based on the application. Creating a requirements document for the sensor is helpful when selecting the appropriate sensor and configuring the pipeline.</p>
<h2 id="heading-sensor-characteristics"><strong>Sensor Characteristics</strong></h2>
<p>Before you dive into the blocks of the sensor pipeline, let’s review some important characteristics of a sensor.</p>
<h3 id="heading-sensitivity"><strong>Sensitivity</strong></h3>
<p>Sensitivity is the ability of a sensor to detect small changes in the physical property it’s designed to measure.</p>
<p>Sensitivity can vary based on factors like manufacturing processes, cost, and the design of the sensing element.</p>
<p>Sensors designed for a specific property often come in different sensitivity levels, allowing users to select an appropriate sensitivity based on the application requirements.</p>
<h3 id="heading-accuracy"><strong>Accuracy</strong></h3>
<p>Accuracy is the degree to which a sensor’s measurement matches the true value of the physical property it’s measuring. Testing a sensor’s accuracy typically requires comparing its readings to those of a reference instrument.</p>
<p>A sensor may have gain and offset errors—issues that calibration can help correct. Calibration adjusts for these systematic errors, which are often due to manufacturing tolerances or design factors.</p>
<p>Once calibrated, the sensor’s output can be verified against a reference to confirm its accuracy. The required level of accuracy should be determined based on the application’s needs.</p>
<h3 id="heading-precision"><strong>Precision</strong></h3>
<p>Precision refers to the consistency or repeatability of a sensor's measurements, regardless of how close those measurements are to the true value. It indicates the sensor's ability to produce the same output under identical conditions and how finely it can resolve and report values.</p>
<p>For example, if the true temperature of an object is 12.53°C:</p>
<ul>
<li><p>A precise sensor will consistently measure values like 12.52°C, 12.53°C, or 12.54°C, even if those values are slightly offset from the true temperature.</p>
</li>
<li><p>A highly accurate sensor, on the other hand, will measure values close to 12.53°C but may lack precision if those readings vary widely (e.g., 12.50°C, 12.53°C, and 12.56°C).</p>
</li>
</ul>
<p>For applications requiring exact measurements, a sensor with both high accuracy (closeness to the true value) and high precision (low variability) is essential. This is especially important in distinguishing small differences, such as between 12.5°C and 12.53°C.</p>
<p>In contrast, applications with less stringent requirements might use sensors with broader tolerances, such as ±1°C, which are sufficient for general monitoring purposes.</p>
<h3 id="heading-range"><strong>Range</strong></h3>
<p>The range of a sensor refers to the span between the maximum and minimum values of the physical property it can measure while maintaining its specified precision and accuracy. A sensor's operating range may extend beyond its measurement range, but the measurement range defines the limits within which the sensor reliably adheres to its specified sensitivity, accuracy, and response time.</p>
<h3 id="heading-drift"><strong>Drift</strong></h3>
<p>Drift is when a sensor's output changes over time due to conditions like temperature or humidity. Components within the sensor, including the sensing element, may be sensitive to these conditions, leading to gradual shifts in measurements.</p>
<p>For example, many components are affected by temperature and humidity changes, which can alter sensor readings. Also, sensors with internal oscillators may experience time-based drift, impacting accuracy.</p>
<p>Regular calibration with an accurate external reference (such as a precise clock) can help correct for drift and maintain reliable measurements. For certain applications, selecting a sensor with acceptable drift characteristics is crucial.</p>
<h3 id="heading-response-time"><strong>Response Time</strong></h3>
<p>Response time is the duration a sensor takes to detect and reflect a change in the measured physical property. For example, if the temperature rises by 5°C, the response time indicates how long the temperature sensor takes to reflect this change in its output.</p>
<p>Response time depends on the sensor’s design, manufacturing quality, and internal components, such as the ADC (Analog-to-Digital Converter), averaging circuits, and filters within the sensor pipeline.</p>
<p>All the parameters mentioned above are thoroughly documented in the sensor’s data-sheet. In practice, it’s a good idea to create a sensor requirements document for each specific application, detailing these key parameters as a baseline for sensor selection.</p>
<p>Now that you’ve examined the key characteristics of sensors, let’s explore how you can connect them to a microcontroller for real-world applications.</p>
<h2 id="heading-how-to-interface-with-a-microcontroller"><strong>How to Interface with a Microcontroller</strong></h2>
<h3 id="heading-choosing-a-communication-protocol">Choosing a Communication Protocol</h3>
<p>Another essential aspect of sensor requirements is specifying the communication interface between the sensor and the MCU or processor in the system. It’s important to understand how the sensor will be interfaced based on its output signal type and the available pins on the microcontroller.</p>
<p>For instance, certain sensors may connect directly to an analog or digital input pin on a microcontroller. A raw sensor, such as a temperature sensor, typically connects to an analog input pin, which is then read by the microcontroller’s internal ADC (Analog-to-Digital Converter).</p>
<p>In contrast, a digital-output sensor connects to a digital GPIO (General Purpose Input/Output) pin. For instance, speed sensors generate square waves with variable pulse widths to indicate speed. These signals are usually connected to a GPIO pin configured as an external interrupt or timer capture input, allowing the microcontroller to measure pulse width accurately.</p>
<p>A smart sensor, on the other hand, often supports communication protocols like SPI (Serial Peripheral Interface) or I2C (Inter-Integrated Circuit). These interfaces enable the microcontroller to configure the sensor, check its status, and retrieve data through register reads and writes.</p>
<p>Choosing the appropriate communication protocol for interfacing a sensor depends on the available pins in the system and the specific requirements of the application.</p>
<p><strong>Tip</strong>: When working with protocols like I²C or SPI, using tools such as <a target="_blank" href="https://www.saleae.com">Saleae</a> logic analyzers can greatly simplify debugging and validation. Logic analyzers capture and visualize communication signals, and tools like Saleae offer built-in protocol interpreters to help you decode sensor communication in real time. This can be especially helpful when troubleshooting configuration issues, timing problems, or communication errors during sensor interfacing.</p>
<p>Figure 2 below shows an example of a microcontroller connected to 4 sensors having different interfaces.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1738828730915/25e62db6-a583-427a-bd77-c61c33990cdf.png" alt="Figure 2: A microcontroller interfacing with different sensors using different communication interfaces." class="image--center mx-auto" width="600" height="400" loading="lazy"></p>
<h3 id="heading-determining-power-requirements">Determining Power Requirements</h3>
<p>Power requirements are another key consideration when interfacing a sensor. Sensors may operate at different voltages (for example, 3.3V or 5V), so ensuring the microcontroller can accommodate these levels is essential. Level converters can bridge voltage mismatches, ensuring compatibility between the sensor and microcontroller voltage levels.</p>
<p>Timing and sampling requirements must also be evaluated, especially for sensors generating high-frequency data. Configuring external interrupts on GPIO pins can ensure timely data capture, while techniques like using DMA can streamline data transfer for sensors sampling at high frequencies without CPU involvement.</p>
<p>Now that you’ve learned about communication protocols and hardware connections, let’s focus on designing the software architecture that acquires, processes, and prepares sensor data for use. Designing effective software is crucial for obtaining clean, reliable data from the sensor.</p>
<h2 id="heading-software-architecture"><strong>Software Architecture</strong></h2>
<p>Now that we’ve chosen the sensor and communication protocol, let’s design the software architecture for the sensor pipeline. This software runs on the microcontroller connected to the sensor and processes raw data to make it clean and usable.</p>
<p>While application-level data processing is beyond the scope of this article, let’s focus on interfacing with the sensor and preparing the data for application use.</p>
<p>The sensor processing pipeline can be broken into the following components:</p>
<ol>
<li><p>Sensor Driver</p>
</li>
<li><p>Analog-to-Digital Conversion (ADC) Support</p>
</li>
<li><p>Scaling</p>
</li>
<li><p>Calibration</p>
</li>
<li><p>Data Post-Processing</p>
</li>
</ol>
<p>Let’s examine a high-level overview of these components for both smart and raw sensors.</p>
<h3 id="heading-high-level-overview-of-components"><strong>High-Level Overview of Components</strong></h3>
<ol>
<li><p><strong>Sensor Driver</strong></p>
<ol>
<li><p>Smart sensors: The driver configures the sensor, manages power, and handles read and write operations to the sensor registers over a communication protocol like SPI, I2C.</p>
</li>
<li><p>Raw sensors: The driver may only control GPIOs for power management, as raw sensors typically lack registers.</p>
</li>
</ol>
</li>
<li><p><strong>Analog-to-Digital Conversion (ADC) Support</strong></p>
<ol>
<li><p>Smart sensors: Include an onboard ADC, which is configured through the sensor driver.</p>
</li>
<li><p>Raw sensors: Requires an external ADC, an ADC driver implemented in software to configure the ADC, initiate conversions, and retrieve data.</p>
</li>
</ol>
</li>
<li><p><strong>Scaling</strong>: Scaling is necessary for both smart and raw sensors. It converts digital counts after the analog to digital conversion into meaningful physical quantities using formulas provided in the sensor data sheet. For example, a temperature sensor will use a formula to convert digital counts to degree Celsius.</p>
</li>
<li><p><strong>Calibration</strong>: Once the measured physical quantity is obtained, calibration adjusts the value by applying offsets, gains, or both to correct errors. This process ensures the sensor output aligns with reference values across its entire measurement range. A detailed discussion of the calibration process will follow in the next section.</p>
</li>
<li><p><strong>Data Post-Processing</strong>: Post-processing techniques, such as filtering are applied to improve data quality and reduce noise. Common filters such as low-pass or high-pass filters can remove unwanted frequency components.</p>
</li>
</ol>
<h3 id="heading-accessing-data-from-the-sensor"><strong>Accessing Data from the Sensor</strong></h3>
<p>The method of accessing data depends on the whether it’s a raw sensor or a smart sensor. Smart sensors will have onboard ADCs and FIFOs. Before delving into how data is accessed, it’s important to first understand sampling frequency.</p>
<h4 id="heading-sampling-frequency">Sampling Frequency:</h4>
<p>The frequency of taking a measurement from the sensor must follow the <a target="_blank" href="https://www.allaboutcircuits.com/technical-articles/nyquist-shannon-theorem-understanding-sampled-systems/">Nyquist-Shannon sampling theorem</a>. It states that the sampling rate must be twice the highest frequency component of the signal to be measured to accurately reconstruct the measured data.</p>
<p>The sampling frequency defines how often the sensor captures data, which affects how the data is accessed. Depending on whether the sensor is a raw sensor or a smart sensor, the approach to handling this sampled data varies.</p>
<p><strong>Smart Sensors:</strong></p>
<ol>
<li><p>Data register: The sensor writes sampled data directly into a register based on the set sample frequency updated during setup. The microcontroller reads this data register based on a data conversion completion interrupt.</p>
</li>
<li><p>FIFObBuffer: Some sensors include FIFO (First-In, First-Out) buffers to store multiple data points. When enabled, the FIFO updates at the configured sampling frequency and trigger interrupts when it becomes full or reaches a predefined level.<br> The benefits of FIFO include:</p>
<ol>
<li><p>Power efficiency: The MCU can process data in batches, reducing CPU overhead and allowing it to enter low-power mode during data collection.</p>
</li>
<li><p>Sampling and processing rate matching: FIFO buffers help reconcile differences between the sensor’s sampling rate and the MCU’s data processing rate.</p>
</li>
<li><p>For MCUs with Direct Memory Access (DMA), data transfer from the sensor to MCU memory can occur without CPU intervention, further reducing power consumption.</p>
</li>
</ol>
</li>
</ol>
<p><strong>Raw Sensors:</strong></p>
<p>For raw sensors, the MCU triggers ADC conversions at the sampling frequency, often using a timer interrupt. Data is read upon the ADC conversion complete interrupt, allowing the MCU to sleep during conversions and between samples to save power.</p>
<h3 id="heading-sensor-power-management"><strong>Sensor Power Management</strong></h3>
<p>Power management is critical for energy-sensitive applications. Strategies include:</p>
<ol>
<li><p>Low-power modes: Many sensors support low-power modes configurable through sensor registers.</p>
</li>
<li><p>GPIO-controlled power cycling (Duty-Cycling): For sensors without built-in low-power modes, the microcontroller can toggle the sensor’s power line using a GPIO pin, reducing power consumption further. Figure 3 below shows the diagram of a raw temperature sensor whose power is controlled using a GPIO from the MCU. For example, a temperature sensor in sleep mode can be activated only when temperature readings are required.</p>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739042040654/1f2d4bbd-f15a-417a-9c79-3b93384e95bd.png" alt="Figure 3: Raw Temperature Sensor Interfacing a MCU" class="image--center mx-auto" width="600" height="400" loading="lazy"></p>
<p>The above techniques ensure efficient use of power while maintaining the required data sampling rate and sensor responsiveness.</p>
<p>With the high-level architecture in mind, we’ll now dive into the detailed design of each pipeline component.</p>
<h2 id="heading-detailed-design-of-components"><strong>Detailed Design of Components</strong></h2>
<p>In this section, you’ll delve into the key components of the sensor pipeline outlined in the Software Architecture section.</p>
<h3 id="heading-1-sensor-driver"><strong>1. Sensor Driver</strong></h3>
<p>The sensor driver is responsible for managing communication, configuration, power, and data acquisition for both smart and raw sensors.</p>
<h4 id="heading-smart-sensor-driver">Smart Sensor Driver:</h4>
<ol>
<li><p>Communication driver: Generic I2C or SPI drivers on the MCU can be adapted using wrapper functions to handle sensor-specific requirements, such as 1-byte, 2-byte, or 4-byte transfers.</p>
</li>
<li><p>Configuration: Typical tasks include setting the sampling rate, configuring interrupts, managing FIFO buffers, and, if needed, clock settings.</p>
</li>
<li><p>Power management: APIs should allow higher software layers to transition sensors between power modes by writing to specific registers or controlling GPIO lines for sensors without built-in power modes.</p>
</li>
</ol>
<h4 id="heading-raw-sensor-driver">Raw Sensor Driver:</h4>
<p>For raw sensors, the driver primarily manages power, often through GPIO-controlled toggling.</p>
<h3 id="heading-2-adc-support"><strong>2. ADC Support</strong></h3>
<p>ADC support is required only for raw sensors. In this article, we’re focusing on SAR ADCs, which are commonly embedded in microcontrollers.</p>
<h4 id="heading-how-sar-adcs-work">How SAR ADCs Work?</h4>
<p>A SAR ADC converts an analog signal to a digital value over multiple clock cycles, with the number of cycles equal to its bit resolution (for example, 10 cycles for a 10-bit ADC).</p>
<h4 id="heading-key-terms-related-to-adcs">Key terms related to ADCs:</h4>
<ol>
<li><p>Reference Voltage (VRef): Represents the maximum voltage the ADC can measure. Analog signals exceeding this limit must be scaled down.</p>
</li>
<li><p>Resolution: Determines the smallest detectable voltage change. For example, a 10-bit ADC with a 3.3V VRef has a resolution of 3.22 mV</p>
</li>
</ol>
<p>$$V_{\text{Res}} = V_{\text{Ref}} /2^{10}$$</p><p>The ADC result is stored in a data register, which can then be scaled to meaningful physical units.</p>
<h3 id="heading-3-scaling"><strong>3. Scaling</strong></h3>
<p>Scaling converts ADC counts into meaningful physical values, such as temperature (°C) or acceleration (g) depending on the sensor type. Sensor datasheets typically provide the necessary formulas or lookup tables.</p>
<p>For example, the method to convert a voltage measured by a raw temperature sensor to temperature value is shown below:</p>
<p>$$V_{\text{Measured}} = Counts_{\text{ADC}} / 2^{10} * V_{\text{Ref}} \quad \text{(Get V_Measured from ADC Counts)}$$</p><p>$$Temperature_{\text{Measured}} = V_{\text{Measured}} * T_{\text{C/mV}} \quad \text{(Get Temperature physical value)}$$</p><p>Similarly, a 3-axis accelerometer maps counts on the X, Y, and Z axes to acceleration values in g or milli-g.</p>
<h3 id="heading-4-calibration"><strong>4. Calibration</strong></h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1738829686302/bfa643dc-5e01-4b24-b885-b682acdb11cb.png" alt="Figure 4a: Calibration with gain &amp; offset | Figure 4b: Calibration with fixed offset" class="image--center mx-auto" width="600" height="400" loading="lazy"></p>
<p>The figure above on the left (4a) is showing Calibration with gain and offset, while the figure above on the right (4b) is showing calibration with fixed offset.</p>
<p>$$x_{\text{calibrated}} = Gain * x_{\text{raw}} + Offset \quad \text{(Figure 4a - Linear Calibration)}$$</p><p>$$x_{\text{calibrated}} = x_{\text{raw}} + Offset \quad \text{(Figure 4b - Fixed offset Calibration)}$$</p><p>Calibration ensures the sensor’s output aligns with reference measurements, correcting for errors introduced by design, materials, or manufacturing.</p>
<h4 id="heading-types-of-errors">Types of Errors:</h4>
<ol>
<li><p>Offset error: A constant deviation of the sensor’s output from the true reference value, regardless of input magnitude.</p>
</li>
<li><p>Gain error: A proportional error where the sensor’s output scale deviates from the expected value, causing the output to increase or decrease incorrectly relative to the input.</p>
</li>
</ol>
<h4 id="heading-calibration-methods">Calibration Methods:</h4>
<ol>
<li><p>2/3-Point calibration: This type of calibration may involve either applying a fixed offset to the raw value or applying both gain and offset. Figure 4a illustrates an example of a gain/offset calibration, while Figure 4b depicts offset calibration. In both figures, the y-axis represents the reference value measured by an accurate instrument, while the x-axis represents the raw value measured by the sensor after ADC.</p>
</li>
<li><p>N-Point calibration: Involves multiple points for more complex, non-linear error correction.</p>
</li>
</ol>
<h4 id="heading-implementation">Implementation:</h4>
<ol>
<li><p>Calibration points shall cover the sensor’s entire measurement range for accuracy.</p>
</li>
<li><p>Parameters like gain and offset once estimated shall be stored in a non-volatile memory in the system for persistence to be used across power cycles.</p>
</li>
</ol>
<h3 id="heading-5-data-post-processing"><strong>5. Data Post-Processing</strong></h3>
<p>Post-processing covered in this section talks about removing noise and unwanted signal components, which improves data reliability.</p>
<h4 id="heading-filtering">Filtering</h4>
<p>Filtering is the process of removing unwanted frequency components from a signal to improve data quality. There are several different types of filters:</p>
<ul>
<li><p>Low-Pass Filters: Allows low-frequency signals to pass while attenuating high-frequency noise.</p>
</li>
<li><p>High-Pass Filters: Allows high-frequency signals to pass while attenuating low-frequency noise. (for example, gravitational acceleration in accelerometer data).</p>
</li>
<li><p>Band-Pass Filters: Retains only signals within a specific frequency range, removing both lower and higher frequencies outside the desired band.</p>
</li>
</ul>
<p>These filters are often implemented as FIR (Finite Impulse Response) or IIR (Infinite Impulse Response) filters. IIR filters are easy to implement and computationally efficient while FIR filters are computationally intensive but have better control over the frequency response.</p>
<p>Here, we will explore a simple low-pass filter known as the Exponential Moving Average (EMA), a type of IIR filter. A moving average filter is a mathematical technique that smooths short-term fluctuations while highlighting longer-term trends.</p>
<p>Unlike other moving average filters, EMA does not require maintaining a buffer, making it more memory-efficient. It is also more responsive to data changes while still providing smoothing, making it well-suited for real-time filtering. EMA assigns greater weight to recent data samples than older ones, allowing it to adapt quickly to changes in sensor readings.</p>
<p>EMA can be calculated like this:</p>
<p>$$EMA_{\text{t}} = \alpha * x_{\text{t}} + (1 - \alpha) * EMA_{\text{t - 1}}$$</p><p>$$\alpha = 2 / (N + 1) \quad \text{(Smoothening Factor, N - filter window size)}$$</p><p>$$EMA_{\text{t}} \quad \text{(Exponential Moving Average in current iteration)}$$</p><p>$$x_{\text{t}} \quad \text{(New Data Sample in Current Iteration)}$$</p><p>$$EMA_{\text{t - 1}} \quad \text{(Exponential Moving Average in the last iteration)}$$</p><p>Now that we understand the Exponential Moving Average (EMA) filter, here are two key factors to consider when tuning it for an application:</p>
<ul>
<li><p>Smoothing vs. Responsiveness: A higher smoothing factor (closer to 1, smaller filter window size) gives more weight to recent data, making the filter more responsive to changes but less effective at noise reduction. A lower smoothing factor (closer to 0, larger filter window size) provides better noise reduction but reacts more slowly to data changes.</p>
</li>
<li><p>Application-Specific Tuning: The smoothing factor should be chosen based on the sampling rate, sensor sensitivity, and application requirements. Real-time systems often require a balance between quick responsiveness and stable output.</p>
</li>
</ul>
<p>Here’s a code sample for EMA:</p>
<pre><code class="lang-c"><span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;stdio.h&gt;</span></span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;stdint.h&gt;</span></span>

<span class="hljs-comment">// Exponential Moving Average (EMA) filter implementation</span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">define</span> FILTER_WINDOW 5</span>

<span class="hljs-comment">// Function to calculate EMA</span>
<span class="hljs-function"><span class="hljs-keyword">float</span> <span class="hljs-title">calculateEMA</span><span class="hljs-params">(<span class="hljs-keyword">float</span> ema, <span class="hljs-keyword">float</span> new_value, <span class="hljs-keyword">float</span> alpha)</span> </span>{
    <span class="hljs-keyword">return</span> (alpha * new_value) + (<span class="hljs-number">1</span> - alpha) * ema;
}

<span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span> </span>{
    <span class="hljs-keyword">float</span> sensorReadings[] = {<span class="hljs-number">26.0</span>, <span class="hljs-number">27.5</span>, <span class="hljs-number">28.2</span>, <span class="hljs-number">27.0</span>, <span class="hljs-number">26.8</span>, <span class="hljs-number">26.5</span>, <span class="hljs-number">27.2</span>};
    <span class="hljs-keyword">int</span> numReadings = <span class="hljs-keyword">sizeof</span>(sensorReadings) / <span class="hljs-keyword">sizeof</span>(sensorReadings[<span class="hljs-number">0</span>]);

    <span class="hljs-keyword">float</span> alpha = <span class="hljs-number">2.0f</span> / (FILTER_WINDOW + <span class="hljs-number">1</span>); <span class="hljs-comment">// Standard EMA formula</span>
    <span class="hljs-keyword">float</span> ema = sensorReadings[<span class="hljs-number">0</span>];  <span class="hljs-comment">// Initialize EMA with the first reading</span>

    <span class="hljs-built_in">printf</span>(<span class="hljs-string">"EMA Filtered Sensor Data:\n"</span>);

    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> i = <span class="hljs-number">0</span>; i &lt; numReadings; i++) {
        ema = calculateEMA(ema, sensorReadings[i], alpha);
        <span class="hljs-built_in">printf</span>(<span class="hljs-string">"Reading %d: Raw = %.2f, EMA = %.2f\n"</span>, i + <span class="hljs-number">1</span>, sensorReadings[i], ema);
    }

    <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;
}
</code></pre>
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<p>In summary, sensors are the backbone of modern smart devices, bridging the gap between the physical world and digital systems. From consumer electronics to industrial automation and medical devices, they enable devices to perceive and interact with their environments.</p>
<p>Understanding how sensors work, the components of their data pipeline, and their integration with microcontrollers is essential for engineers and hobbyists alike. By designing effective pipelines, developers can ensure accurate, clean, and reliable data, enabling systems to meet performance and power efficiency goals.</p>
<p>If you have questions or want to talk more about this topic, feel free to reach out on <a target="_blank" href="https://x.com/sohamstars">Twitter</a> or <a target="_blank" href="https://x.com/sohamstars">Lin</a><a target="_blank" href="https://www.linkedin.com/in/sohambanerjee2/">kedIn</a>. Always happy to connect.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How Does a CPU Work Internally? From Transistors to Instruction Set Architecture ]]>
                </title>
                <description>
                    <![CDATA[ The CPU (Central Process Unit) is the brain of a computer, and the main connection between software and hardware. It makes it possible to operate software on hardware. However, how does it work in deep detail? And how can it connect programs to certa... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-does-cpu-work-internally/</link>
                <guid isPermaLink="false">66ba5326f4ac8da2b2c2e847</guid>
                
                    <category>
                        <![CDATA[ Computers ]]>
                    </category>
                
                    <category>
                        <![CDATA[ cpu ]]>
                    </category>
                
                    <category>
                        <![CDATA[ hardware ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Tiago Capelo Monteiro ]]>
                </dc:creator>
                <pubDate>Wed, 10 Jul 2024 19:14:05 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2024/07/1.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>The CPU (Central Process Unit) is the brain of a computer, and the main connection between software and hardware. It makes it possible to operate software on hardware.</p>
<p>However, how does it work in deep detail? And how can it connect programs to certain computer hardware?</p>
<p>This article aims to make you understand this connection by deeply explaining how a CPU works. This topic is often familiar only to those with a background in computer hardware design from college.</p>
<p>Often, many computer science graduates never have a class in advanced digital logic. So even very experienced programmers may lack an understanding of how a CPU actually processes information.</p>
<p>Although we won't be designing <a target="_blank" href="https://www.homemade-circuits.com/how-to-make-logic-gates-using-transistors/">logic gates from transistors</a> or <a target="_blank" href="https://www.techspot.com/article/1830-how-cpus-are-designed-and-built-part-2/">CPU components from logic gates</a>, we will cover the key concepts needed to understand how a CPU processes data created by a program written in a programming language.</p>
<p>We will see:</p>
<ul>
<li><a class="post-section-overview" href="#heading-analogy-introduction-to-what-makes-cpus-work">Analogy: Introduction to What Makes CPUs Work</a></li>
<li><a class="post-section-overview" href="#heading-the-memory-hubs-understanding-ram-and-rom">The Memory Hubs: Understanding RAM and ROM</a></li>
<li><a class="post-section-overview" href="#heading-the-roadways-of-data-navigating-the-cpu-data-path">The Roadways of Data: Navigating the CPU Data Path</a></li>
<li><a class="post-section-overview" href="#heading-traffic-controllers-the-role-of-state-machines-in-cpus">Traffic Controllers: The Role of State Machines in CPUs</a></li>
<li><a class="post-section-overview" href="#heading-daily-routines-the-fetch-execute-cycle-explained">Daily Routines: The Fetch-Execute Cycle Explained</a></li>
<li><a class="post-section-overview" href="#heading-the-rulebook-decoding-the-instruction-set-architecture-isa">The Rulebook: Decoding the Instruction Set Architecture (ISA)</a></li>
<li><a class="post-section-overview" href="#heading-from-programming-languages-to-machine-code">From programming languages to machine code</a></li>
<li><a class="post-section-overview" href="#heading-city-challenges-addressing-cpu-problems">City Challenges: Addressing CPU Problems</a></li>
<li><a class="post-section-overview" href="#heading-conclusion-better-control-units-and-data-parts">Conclusion: Better control units and data parts</a></li>
</ul>
<p>I will use the Intel 8008 as a reference. </p>
<h2 id="analogy">Analogy: Introduction to What Makes CPUs Work</h2>

<p>To understand deeply how a computer works, let's imagine a city as our real-life scenario. We'll compare computer elements to parts of this city.</p>
<p>This way, you get a clearer view of different CPU parts and why they are important. Afterwards, we will look in depth to each of the components</p>
<h3 id="heading-the-memory-hubs-understanding-ram-and-rom">The Memory Hubs: Understanding RAM and ROM</h3>
<p>RAM (Random access memory) is like a city public library: it stores books and information for people to borrow and return as needed.</p>
<p>In a computer, the RAM loads data and instructions from the computer memory needed by the CPU to process data.</p>
<p>ROM (read Only Memory) is like a historical archive in the city: It only stores records that will never change and never be borrowed from the public.</p>
<h3 id="heading-the-roadways-of-data-navigating-the-cpu-data-path">The Roadways of Data: Navigating the CPU Data Path</h3>
<p>The CPU data path is the network of roads in the city. The buses and registers of the CPU data path act like the city's road network.</p>
<p>Just as roads help cars and people move, the CPU data path guarantee the data travels in a efficient manner in the CPU</p>
<h3 id="heading-traffic-controllers-the-role-of-state-machines-in-cpus">Traffic Controllers: The Role of State Machines in CPUs</h3>
<p>States machines act as the traffic control systems.</p>
<p>The traffic control system manages the flow of vehicles, and the states machines manage the flow of data according to the instructions provided to the CPU.</p>
<h3 id="heading-daily-routines-the-fetch-execute-cycle-explained">Daily Routines: The Fetch-Execute Cycle Explained</h3>
<p>The fetch-execute cycle is the daily commute for city residents.</p>
<p>Every day, people decide where they are going, travel there, perform their tasks and return home. This process is always repeated.</p>
<p>In the same way, the CPU fetches instructions, decodes them, and executes them in a repetitive cycle.</p>
<h3 id="heading-the-rulebook-decoding-the-instruction-set-architecture-isa">The Rulebook: Decoding the Instruction Set Architecture (ISA)</h3>
<p>The instruction set architecture is like the city transportation law.</p>
<p>The city transportation law shows what is legal to do in the city in relation to the transportation of people.</p>
<p>The instruction set architecture is the set of rules and instructions that the CPU can execute.</p>
<h2 id="memory">The Memory Hubs: Understanding RAM and ROM</h2>

<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/3.jpg" alt="Image" width="600" height="400" loading="lazy">
<em>Photo by Valentine Tanasovich: https://www.pexels.com/photo/black-and-gray-computer-motherboard-2588757/</em></p>
<p><a target="_blank" href="https://www.freecodecamp.org/news/how-to-access-and-read-ram-contents/">RAM stands for Random Access Memory and can be used to read and write data.</a></p>
<p>The CPU gets data from the computer memory to the RAM first to avoid long waiting times.</p>
<p>Then, it uses the data from the RAM to complete the instructions.</p>
<p>They are used in computers and in many electronic devices due to the memory being volatile. It means that the data is only there while the computer is turned on, making it ideal for temporal storage while the device works.</p>
<p>ROM stands for Read Only Memory. In there, there only exist data added during computer manufacturing.</p>
<p>They are widely used in <a target="_blank" href="https://www.freecodecamp.org/news/what-is-firmware/">firmware</a> for devices, BIOS and small embedded systems.</p>
<p>This is because ROM is non-volatile memory. This means that it remains in memory when the device is powered off, making it very important for permanent data storage.</p>
<h2 id="roadways">The Roadways of Data: Navigating the CPU Data Path</h2>

<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/4.png" alt="Image" width="600" height="400" loading="lazy">
<em>Photo by Rogeer Marques: https://www.pexels.com/photo/close-up-shot-of-a-chip-processor-11272008/</em></p>
<p>The CPU data path is a complex digital circuit with many components that work with one another, such as:</p>
<ul>
<li><strong>Arithmetic Logic Unit (ALU):</strong> Performs arithmetic and logical operations inside the CPU data part.</li>
<li><strong>Registers:</strong> Small, fast storage locations for temporary data retrieved from the RAM.</li>
<li><strong>Buses:</strong> Data, control and address buses are wires used inside the CPU data path to transfer information.</li>
</ul>
<p>While CPUs have changed a lot since the Intel 8008, these are some of the components that still serve as the foundation for all CPUs.</p>
<p>Thanks to them, it is possible to let data flow, but not control the actual flow. This is the job of the control unit in the CPU, created in the Intel 8008 as state machines.</p>
<h2 id="traffic">Traffic Controllers: The Role of State Machines in CPUs</h2>

<p><a target="_blank" href="https://www.freecodecamp.org/news/state-machines-basics-of-computer-science-d42855debc66/">A state machine is a system that transitions between different states in order to perform tasks.</a></p>
<p>They are composed of a number of states and transitions. They were used in the Intel 8008 to create the control unit due to its structure and effective way to manage the sequence of operations needed to process instructions</p>
<p>Each of the states can activate one or many CPU components to process a certain assembly instruction.</p>
<p>This way, certain CPU data path parts are activated for an instruction to be completed.</p>
<p>Additionally, thanks to these state machines, the CPU is complete and can perform all instructions a user wants in a continuous loop called the fetch-execute cycle.</p>
<h2 id="fetch">Daily Routines: The Fetch-Execute Cycle Explained</h2>

<p>The state machine in the CPU controls how the CPU data path works together to perform a given instruction.</p>
<p>Nowadays, every computer receives millions of instructions per second. This way, the state machines act as a loop to get the instructions and execute them.</p>
<p>This process is known as the fetch-execute cycle, where the CPU retrieves and executes instructions:</p>
<ul>
<li><strong>Fetch:</strong> The CPU fetches the instruction from memory.</li>
<li><strong>Decode:</strong> The fetched instruction is decoded to determine the required action.</li>
<li><strong>Execute:</strong> The decoded instruction is executed using the appropriate CPU components.</li>
<li><strong>Write-back:</strong> The result of the execution is written back to memory or a register.</li>
</ul>
<p>In the fetch stage, the control unit tells the RAM to give the next instruction to the CPU.</p>
<p>In the decode stage, the CPU interprets the instruction, and in the execution stage, it performs the operation. Afterwards, the write-back stage ensures the result is stored correctly.</p>
<p>This cycle continues while the PC is on. This way, in modern processors, processing billions of instructions per second.</p>
<h3 id="heading-but-what-about-data-from-the-keyboard-or-mouse">But What About Data from the Keyboard or Mouse?</h3>
<p>This data does not come from RAM but is handled through a mechanism called interrupts. While the CPU runs instructions, it can detect when data comes from peripherals.</p>
<p>If this happens, the CPU stops its current task and prioritizes the instructions from the peripherals. Afterwards, the CPU resumes its previous tasks.</p>
<p>There are many ways to manage interrupts, with some of the most popular being:</p>
<ol>
<li><strong>Polled Interrupts</strong>: The CPU periodically checks if an interrupt has occurred.</li>
<li><strong>Vectored Interrupts</strong>: The interrupting device directs the CPU to the appropriate interrupt service routine.</li>
<li><strong>Prioritized Interrupts</strong>: Interrupts are assigned different priority levels, ensuring critical tasks are handled first.</li>
</ol>
<p>This way, with these mechanisms, the CPU maintains its performance while interacting the peripherals.</p>
<h2 id="instruction">The Rulebook: Decoding the Instruction Set Architecture (ISA)</h2>

<p>With the control unit, the complete CPU and RAM, it is possible to perform many instructions.</p>
<p>But what instructions can be performed on a given CPU? And how many? This is what the Instruction Set Architecture (ISA) solves.</p>
<p>The ISA defines a set of instructions that a certain CPU can execute. It is what allows programmers to understand what a processor can and cannot do without having to understand all the digital logic hardware inside it.</p>
<p>This way, it acts as an interface between software and hardware.</p>
<p><strong>Key Aspects of ISA:</strong></p>
<ul>
<li><strong>Instruction Types:</strong> Includes arithmetic, logical, control, and data transfer instructions.</li>
<li><strong>Addressing Modes:</strong> Methods for specifying operands of instructions.</li>
<li><strong>Registers:</strong> The set of registers available for use by instructions.</li>
</ul>
<p><strong>Common ISAs:</strong></p>
<ul>
<li><strong>x86:</strong> Widely used in desktop and server processors.</li>
<li><strong>ARM:</strong> Dominant in mobile and embedded devices due to its power efficiency.</li>
<li><strong>RISC-V:</strong> An open standard ISA designed for a wide range of applications.</li>
</ul>
<p>Each CPU often has its own version of the instruction-set architecture. And the instruction set architecture is very often defined with the assembly programming languages.</p>
<p>This is why there are so <a target="_blank" href="https://www.freecodecamp.org/news/what-are-assembly-languages/">many versions</a> of the assembly programming language.</p>
<p>Since each CPU has its own hardware specifications, each will have similar components to other CPUs and, thus, similar assembly programming languages associated.</p>
<p>The choice of ISA impacts the CPU's design, performance, and compatibility with software.</p>
<p>For instance, the complexity of x86 allows for powerful desktop applications, while ARM's simplicity favors energy-efficient mobile devices.</p>
<h2 id="programming">From Programming Languages to Machine Code</h2>

<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/3-1.jpg" alt="Image" width="600" height="400" loading="lazy">
<em>Photo by luis gomes: https://www.pexels.com/photo/close-up-photo-of-programming-of-codes-546819/</em></p>
<p>While each processor has its own assembly language, managing code in assembly and writing code in assembly to make big programs can be complex.</p>
<p>It is very complicated, and may lead to wasting time on correcting things and details instead of, in a faster and easier way, managing the development of a program and actually developing it.</p>
<p>To solve this problem, many programming languages were created from assembly. We write the code in the programming languages, and it is then converted to assembly.</p>
<p>This way, instead of spending time on details, it is possible to focus on more important things like system development and algorithm design.</p>
<p>This is the process by which most programming languages convert their code into assembly:</p>
<ol>
<li>Convert the code to assembly code through either a compiler or interpreter.</li>
<li>The assembly code is then converted to raw machine code and executed by the CPU.</li>
<li>A specific loop in the CPU's state machine is completed.</li>
<li>Afterward, the CPU fetches and executes the next instruction.</li>
</ol>
<p>Let's see two examples of programming languages doing this!</p>
<h3 id="heading-c-programming-language">C Programming Language</h3>
<p>The C programming language was created from assembly in the early 1970s. It was created to provide a higher-level language for efficient system-level programming that also allows hardware manipulation.</p>
<p>With a compiler, the C code is converted to assembly and then processed by the complete CPU.</p>
<p>Thanks to this conversion, by writing programs in the C programming language, we can address many problems in a more efficient manner, such as:</p>
<ul>
<li>Memory management errors</li>
<li>Buffer overflows</li>
<li>Manual optimization issues</li>
</ul>
<p>Nowadays, even for simpler tasks, the assembly code converted from C compiler is far more efficient and reliable than a human writing the assembly code.</p>
<p>If you want to learn more about the C compiler you can check out:</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.freecodecamp.org/news/what-is-a-compiler-in-c/">https://www.freecodecamp.org/news/what-is-a-compiler-in-c/</a></div>
<h3 id="heading-python-programming-language">Python Programming Language</h3>
<p>The Python programming language was created from C in the late 1980s.</p>
<p>Its goal was to provide a user-friendly, high-level programming language that emphasizes readability and simplicity, allowing for rapid application development.</p>
<p>In Python, an interpreter converts the Python code to bytecode line by line.</p>
<p>And this bytecode is converted to machine code in the CPU and processed in the fetch-execute cycle.</p>
<p>This way, it is possible for people to program in an easier way and focus on bigger programs, such as:</p>
<ul>
<li>Artificial intelligence models</li>
<li>Web apps</li>
<li>Data analysis</li>
<li>Scientific computing</li>
</ul>
<p>However, the challenge with the CPUs in all programming languages is that it processes data sequentially.</p>
<h2 id="problems">City Challenges: Addressing CPU Problems</h2>

<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/4-1.jpg" alt="Image" width="600" height="400" loading="lazy">
<em>Photo by Peng LIU: https://www.pexels.com/photo/timelapse-photography-of-vehicle-on-concrete-road-near-in-high-rise-building-during-nighttime-169677/</em></p>
<p>The traditional one core CPU processes data sequentially, instruction after instruction. This becomes a limitation if we have many instructions to process.</p>
<p>This is what GPUs (Graphics processing units) came to fix.  Thanks to GPUs, we can process instructions in parallel, thereby reducing computing time significantly.</p>
<p>With these parallel processing capabilities, it is possible to achieve a much faster computation and improved efficiency in a wide range of applications.</p>
<h2 id="conclusion">Conclusion: Better Control Units and Data Parts</h2>

<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/5.jpg" alt="Image" width="600" height="400" loading="lazy">
<em>Photo by Miguel Á. Padriñán: https://www.pexels.com/photo/green-circuit-board-343457/</em></p>
<p>In addition to modern CPUs being multicore, advancements in control units and data paths play a critical role in improving processor performance. </p>
<p>Control units are often designed using microprogramming or hardwired control units. </p>
<p>Microprogramming offers greater flexibility and easier updates to the control logic, while hardwired control units provide faster performance by directly implementing control signals.</p>
<p>Another significant advancement is the exploration of new materials for transistors in logic gates. </p>
<p>Instead of relying solely on silicon, researchers are investigating alternative materials to create faster and more efficient processors.</p>
<p>As technology continues to advance, understanding these fundamental concepts will remain essential for both enthusiasts and professionals in the field.</p>
<p>Keeping up with these developments ensures the continued innovation and improvement of CPU design and functionality.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Podcast: Hardware Engineering with Bruno Haid ]]>
                </title>
                <description>
                    <![CDATA[ On this week's episode of the freeCodeCamp Podcast, I interview hardware engineer and tech founder from Austria. We talk about growing up in the European countryside, his early passion for computers, and ultimately his move to San Francisco, where he... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/podcast-hardware-engineering-bruno-haid/</link>
                <guid isPermaLink="false">66b8d5148cd1c2aa053d499a</guid>
                
                    <category>
                        <![CDATA[ embedded systems ]]>
                    </category>
                
                    <category>
                        <![CDATA[ hardware ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Internet of Things ]]>
                    </category>
                
                    <category>
                        <![CDATA[ podcast ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Quincy Larson ]]>
                </dc:creator>
                <pubDate>Fri, 24 Nov 2023 21:17:27 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2023/11/signal-2023-11-24-141140_002_jpeg.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>On this week's episode of the freeCodeCamp Podcast, I interview hardware engineer and tech founder from Austria.</p>
<p>We talk about growing up in the European countryside, his early passion for computers, and ultimately his move to San Francisco, where he's founded several tech companies.</p>
<p>Bruno's super excited about embedded systems and custom hardware. He's building home appliances that incorporate open source software and open datasets.</p>
<p>We cover so many topics here. From Star Trek to the European Pirate Party.</p>
<p>I hope these weekly freeCodeCamp podcasts are firing you up about learning more about technology.</p>
<p>Be sure to follow The freeCodeCamp podcast in your favorite podcast app. And share this podcast with a friend. Let's inspire more folks to learn to code and build careers for themselves in tech.</p>
<p>You can listen to the podcast in Apple Podcasts, Spotify, or your favorite podcast app. You can also listen to the podcast below, right in your browser:</p>
<div class="embed-wrapper"><iframe src="https://play.libsyn.com/embed/episode/id/28783273/height/192/theme/modern/size/large/thumbnail/yes/custom-color/34345c/time-start/00:00:00/playlist-height/200/direction/backward/download/yes" height="192" width="100%" style="border:none" title="Embedded content" loading="lazy"></iframe></div>



<p>A couple interesting links from our discussion: </p>
<ul>
<li><a target="_blank" href="https://www.youtube.com/watch?v=PWeO5IkCssk">"Only Amiga" song from Comdex 1987</a></li>
<li><a target="_blank" href="https://www.youtube.com/watch?v=pWrioRji60A">Halt and Catch Fire TV Show trailer</a></li>
</ul>
<p>And here are some bonus photos from my time at Bruno's house in NYC:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/11/Bruno_s_office_jpeg.png" alt="Image" width="600" height="400" loading="lazy">
<em>Bruno at work in his office</em></p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/11/A_project_by_Bruno_jpeg.png" alt="Image" width="600" height="400" loading="lazy">
<em>A hardware project Bruno had prototyped in his bedroom. (This is the photo that I mentioned during the interview that I had snuck in to snap.)</em></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Provision a Nexus Sonatype OSS on an Orange PI 5 with Ansible ]]>
                </title>
                <description>
                    <![CDATA[ Nexus 3 OSS is an Open Source artifact repository manager that can handle multiple formats like container images, Python PIP, Java jar, and many others. Why have an on-premise artifact manager? There are many reasons for it: Use your private infrast... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/provision-nexus-sonatype-oss-on-an-orange-pi-5-with-ansible/</link>
                <guid isPermaLink="false">66d85148f20d0925f8515b0d</guid>
                
                    <category>
                        <![CDATA[ hardware ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Linux ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Raspberry Pi ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Jose Vicente Nunez ]]>
                </dc:creator>
                <pubDate>Fri, 05 May 2023 21:34:24 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2023/05/cropped_museum.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Nexus 3 OSS is an <a target="_blank" href="https://github.com/sonatype/nexus-public">Open Source</a> <a target="_blank" href="https://www.sonatype.com/products/repository-oss">artifact repository manager</a> that can handle multiple formats like container images, Python PIP, Java jar, and many others.</p>
<p>Why have an on-premise artifact manager? There are many reasons for it:</p>
<ul>
<li><p>Use your private infrastructure: You may have proprietary code that needs to be safeguarded.</p>
</li>
<li><p>Faster artifact download speeds: If you constantly download the same artifacts over the Internet, you can cache them on a central location, for the benefit of your multiple users across multiple servers by caching them.</p>
</li>
<li><p>Control what artifacts make it to your build chain: Centralize the location of the artifacts, ensure they are approved for usage, and also confirm than they do not contain malicious code.</p>
</li>
<li><p>Segregate who can have access to your artifacts: You may have more strict requirements on who can access some artifacts within your own organization.</p>
</li>
</ul>
<p>In this article I will show you how you can download, install, and configure the OSS version of Nexus 3 using an Ansible playbook.</p>
<p>Nexus 3 will run on an <a target="_blank" href="http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-5.html">Orange PI 5 computer with 8 GB or RAM</a>, but this provisioning can be done on any machine with the <a target="_blank" href="https://help.sonatype.com/repomanager3/product-information/sonatype-nexus-repository-system-requirements">minimum requirements</a>. Part of the setup will consist of setting a proxy for <a target="_blank" href="https://pypi.org/">PyPI.org</a>, for the machines listed on my <a target="_blank" href="https://tutorials.kodegeek.com/Nexus3OnOrangePI/ansible/inventories/home/hosts.yaml">inventory</a> file.</p>
<h2 id="heading-what-you-need-to-run-the-code-from-this-tutorial">What you need to run the code from this tutorial</h2>
<ol>
<li><p>An Internet connection to download the <a target="_blank" href="https://github.com/josevnz/Nexus3OnOrangePI">source code</a> for the Ansible playbook, Nexus, and PIP modules</p>
</li>
<li><p>Two or more Linux machines (I used <a target="_blank" href="https://raspi.debian.net/">Debian</a>, <a target="_blank" href="https://www.armbian.com/orangepi-5/">Armbian</a> and <a target="_blank" href="https://getfedora.org/iot/">Fedora IOT</a>), with at least 8 GB of RAM. My cluster has a mix of Raspberry PI 4 and an OrangePI 5.</p>
</li>
<li><p>Ansible controller will run on the Fedora machine, but any server can be the controller. <a target="_blank" href="https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html">Installation instructions for Ansible</a> are easy to follow.</p>
</li>
</ol>
<h2 id="heading-playbook-organization">Playbook Organization</h2>
<p>I divided the tasks in groups and the resulting playbook looks like this:</p>
<pre><code class="lang-shell">[josevnz@dmaf5 Nexus3OnOrangePI]$ tree -N ansible/
ansible/
├── inventories
│   └── home
│       └── hosts.yaml
├── roles
│   ├── clients
│   │   ├── tasks
│   │   │   └── main.yaml
│   │   └── templates
│   │       └── pip.conf.j2
│   └── nexus
│       ├── files
│       │   └── swagger.json
│       ├── tasks
│       │   ├── download.yaml
│       │   ├── install.yaml
│       │   ├── main.yaml
│       │   ├── post_install.yaml
│       │   ├── pre_install.yaml
│       │   ├── repositories.yaml
│       │   ├── third_party.yaml
│       │   └── user.yaml
│       └── templates
│           ├── logrotate.nexus3.j2
│           ├── nexus3.service.j2
│           ├── nexus.rc.j2
│           └── nexus.vmoptions.j2
├── site.yaml
├── vars
│   ├── clients.yaml
│   └── nexus.yaml
└── vault
    ├── nexus_password.enc
    └── README.md

13 directories, 21 files
</code></pre>
<p>Now a little bit of explaining:</p>
<ul>
<li><p>There are two roles: ‘nexus’ and ‘clients’. The nexus role is used to setup the artifact management software, while the client role sets up the <a target="_blank" href="https://docs.python.org/3/installing/index.html">pip</a> settings on every machine.</p>
</li>
<li><p>Vars contains variables used on each role, separated by files to make their usage more clear</p>
</li>
<li><p>We have passwords, and we managed them using <a target="_blank" href="https://docs.ansible.com/ansible/latest/cli/ansible-vault.html">Ansible vault</a> feature.</p>
</li>
<li><p>The file ‘<a target="_blank" href="https://tutorials.kodegeek.com/Nexus3OnOrangePI/ansible/site.yaml">site.yaml</a>’ Orchestrates the role execution:</p>
</li>
</ul>
<pre><code class="lang-yaml"><span class="hljs-bullet">-</span> <span class="hljs-attr">hosts:</span> <span class="hljs-string">all</span>
  <span class="hljs-attr">tags:</span> <span class="hljs-string">clients</span>
  <span class="hljs-attr">vars_files:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-string">vars/clients.yaml</span>
  <span class="hljs-attr">roles:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-string">clients</span>
<span class="hljs-bullet">-</span> <span class="hljs-attr">hosts:</span> <span class="hljs-string">nexus_server</span>
  <span class="hljs-attr">tags:</span> <span class="hljs-string">nexus</span>
  <span class="hljs-attr">become_user:</span> <span class="hljs-string">root</span>
  <span class="hljs-attr">become:</span> <span class="hljs-literal">true</span>
  <span class="hljs-attr">vars_files:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-string">vars/nexus.yaml</span>
  <span class="hljs-attr">roles:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-string">nexus</span>
</code></pre>
<p>Now let’s move on to see the universe where the playbook will be executed.</p>
<h2 id="heading-the-host-inventory">The Host Inventory</h2>
<p>In my case it is quite simple – I have two main groups: ‘clients’ and the machine where the Nexus 3 server itself will run:</p>
<pre><code class="lang-yaml"><span class="hljs-attr">all:</span>
  <span class="hljs-attr">children:</span>
    <span class="hljs-attr">nexus_server:</span>
      <span class="hljs-attr">hosts:</span>
        <span class="hljs-attr">orangepi5.home:</span>
    <span class="hljs-attr">home_lab:</span>
      <span class="hljs-attr">hosts:</span>
        <span class="hljs-attr">dmaf5.home:</span>
        <span class="hljs-attr">raspberrypi.home:</span>
        <span class="hljs-attr">orangepi5.home:</span>
</code></pre>
<p>The next important task is to download and configure Nexus 3.</p>
<h2 id="heading-how-to-install-nexus-3">How to Install Nexus 3</h2>
<p>The file <a target="_blank" href="https://tutorials.kodegeek.com/Nexus3OnOrangePI/ansible/roles/nexus/tasks/main.yaml">main.yaml</a> describes the order and purpose of each installation task for the Nexus role:</p>
<pre><code class="lang-yaml"><span class="hljs-comment"># Tasks listed here are related to the remote Nexus 3 server</span>
<span class="hljs-comment"># Included tasks are called in order</span>
<span class="hljs-meta">---</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">include_tasks:</span> <span class="hljs-string">third_party.yaml</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">include_tasks:</span> <span class="hljs-string">pre_install.yaml</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">include_tasks:</span> <span class="hljs-string">download.yaml</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">include_tasks:</span> <span class="hljs-string">install.yaml</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">include_tasks:</span> <span class="hljs-string">post_install.yaml</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">include_tasks:</span> <span class="hljs-string">user.yaml</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">include_tasks:</span> <span class="hljs-string">repositories.yaml</span>
</code></pre>
<p>Let’s see first what I like to call the “core tasks”:</p>
<ol>
<li><p><a target="_blank" href="https://tutorials.kodegeek.com/Nexus3OnOrangePI/ansible/roles/nexus/tasks/third_party.yaml">third_party.yaml</a>: In here we install the OpenJDK8 (Nexus 3 is written in Java) and logrotate to take care of the stale logs.</p>
</li>
<li><p><a target="_blank" href="https://tutorials.kodegeek.com/Nexus3OnOrangePI/ansible/roles/nexus/tasks/pre_install.yaml">pre_install.yaml</a>: A lot happens here, like creating required directories for nexus, dedicated non-privileged user that will run the process.</p>
</li>
<li><p><a target="_blank" href="https://tutorials.kodegeek.com/Nexus3OnOrangePI/ansible/roles/nexus/tasks/download.yaml">download.yaml</a>: As the name says, we get a fresh version of the Nexus 3 OSS software and make sure it has the right checksum. We don’t want to install malware from the Internet.</p>
</li>
</ol>
<p>Then come the tasks that fall into the “customized installation group”:</p>
<ol>
<li><p><a target="_blank" href="https://tutorials.kodegeek.com/Nexus3OnOrangePI/ansible/roles/nexus/tasks/install.yaml">install.yaml</a>: Unpack the software, prepare the systemd unit to start it automatically, setup JVM settings for Nexus, and deploy the logrotate configuration.</p>
</li>
<li><p><a target="_blank" href="https://tutorials.kodegeek.com/Nexus3OnOrangePI/ansible/roles/nexus/tasks/post_install.yaml">post_install.yaml</a>: Exciting stuff happens here – the software is installed, and we run it for the first time. We also change the default password <a target="_blank" href="https://help.sonatype.com/repomanager3/integrations/rest-and-integration-api">using the REST API</a>, so we can move to the customization stage.</p>
</li>
<li><p><a target="_blank" href="https://tutorials.kodegeek.com/Nexus3OnOrangePI/ansible/roles/nexus/tasks/user.yaml">user.yaml</a>: Here we prepare to provide our end users with proper access to the services offered by Nexus. We do this using a combination of the REST-API and Ansible client code:</p>
</li>
</ol>
<pre><code class="lang-yaml"><span class="hljs-comment"># https://help.sonatype.com/repomanager3/installation-and-upgrades/post-install-checklist</span>
<span class="hljs-comment"># https://help.sonatype.com/repomanager3/integrations/rest-and-integration-api</span>
<span class="hljs-meta">---</span>
<span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Enable</span> <span class="hljs-string">anonymous</span> <span class="hljs-string">user</span>
  <span class="hljs-attr">tags:</span> <span class="hljs-string">anonymous</span>
  <span class="hljs-attr">ansible.builtin.uri:</span>
    <span class="hljs-attr">user:</span> <span class="hljs-string">""</span>
    <span class="hljs-attr">password:</span> <span class="hljs-string">""</span>
    <span class="hljs-attr">url:</span> <span class="hljs-string">"/v1/security/anonymous"</span>
    <span class="hljs-attr">method:</span> <span class="hljs-string">PUT</span>
    <span class="hljs-attr">body_format:</span> <span class="hljs-string">raw</span>
    <span class="hljs-attr">status_code:</span> [ <span class="hljs-number">200</span>, <span class="hljs-number">202</span>, <span class="hljs-number">204</span> ]
    <span class="hljs-attr">headers:</span>
      <span class="hljs-attr">Content-Type:</span> <span class="hljs-string">application/json</span>
    <span class="hljs-attr">body:</span> <span class="hljs-string">|-
      { "enabled" : true, "userId" : "anonymous", "realmName" : "NexusAuthorizingRealm" }
</span>    <span class="hljs-attr">force_basic_auth:</span> <span class="hljs-literal">true</span>
    <span class="hljs-attr">return_content:</span> <span class="hljs-literal">true</span>
  <span class="hljs-attr">any_errors_fatal:</span> <span class="hljs-literal">true</span>
<span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Enable</span> <span class="hljs-string">Docker</span> <span class="hljs-string">security</span> <span class="hljs-string">realm</span>
  <span class="hljs-attr">tags:</span> <span class="hljs-string">docker_realm</span>
  <span class="hljs-attr">ansible.builtin.uri:</span>
    <span class="hljs-attr">user:</span> <span class="hljs-string">""</span>
    <span class="hljs-attr">password:</span> <span class="hljs-string">""</span>
    <span class="hljs-attr">url:</span> <span class="hljs-string">"/v1/security/realms/active"</span>
    <span class="hljs-attr">method:</span> <span class="hljs-string">PUT</span>
    <span class="hljs-attr">body_format:</span> <span class="hljs-string">raw</span>
    <span class="hljs-attr">status_code:</span> [ <span class="hljs-number">200</span>, <span class="hljs-number">202</span>, <span class="hljs-number">204</span> ]
    <span class="hljs-attr">headers:</span>
      <span class="hljs-attr">Content-Type:</span> <span class="hljs-string">application/json</span>
    <span class="hljs-attr">body:</span> <span class="hljs-string">|-
      [ "NexusAuthenticatingRealm", "NexusAuthorizingRealm", "DockerToken" ]
</span>    <span class="hljs-attr">force_basic_auth:</span> <span class="hljs-literal">true</span>
    <span class="hljs-attr">return_content:</span> <span class="hljs-literal">true</span>
  <span class="hljs-attr">any_errors_fatal:</span> <span class="hljs-literal">true</span>
</code></pre>
<p>The logic is easy to follow, by using the ‘PUT’ http method you can tell is a modification operation (meaning existing roles and users already exist). Error detection is done by getting the HTTP codes returned by Nexus.</p>
<p>Next step is to prepare our local PyPi proxy. This is a multistep task and will be described in detail next.</p>
<h2 id="heading-how-to-set-up-pypi-proxy-on-nexus-3">How to Set Up PyPI Proxy on Nexus 3</h2>
<p>The last file on the Nexus 3 role is ‘<a target="_blank" href="https://tutorials.kodegeek.com/Nexus3OnOrangePI/ansible/roles/nexus/tasks/repositories.yaml">repositories.yaml</a>’. In here we go through the following steps:</p>
<ol>
<li><p>Check if the proxy was already setup (GET or read only operation)</p>
</li>
<li><p>If it doesn’t exist, create a new one (POST method with JSON payload with details to create whole new repository)</p>
</li>
</ol>
<p>Notice than this playbook doesn’t offer the option to update repository settings. It is possible to do with the REST API, but I will leave that as an exercise to the reader.</p>
<p>The tasks to prepare the PyPi proxy are shown below:</p>
<pre><code class="lang-yaml"><span class="hljs-comment"># Create proxy for repositories</span>
<span class="hljs-comment"># https://help.sonatype.com/repomanager3/integrations/rest-and-integration-api</span>
<span class="hljs-comment"># PyPi: https://pip.pypa.io/en/stable/user_guide/</span>
<span class="hljs-meta">---</span>
<span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Check</span> <span class="hljs-string">if</span> <span class="hljs-string">the</span> <span class="hljs-string">PyPi</span> <span class="hljs-string">proxy</span> <span class="hljs-string">exists</span>
  <span class="hljs-attr">tags:</span> <span class="hljs-string">pypi_proxy_exists</span>
  <span class="hljs-attr">ansible.builtin.uri:</span>
    <span class="hljs-attr">user:</span> <span class="hljs-string">""</span>
    <span class="hljs-attr">password:</span> <span class="hljs-string">""</span>
    <span class="hljs-attr">url:</span> <span class="hljs-string">"/v1/repositories/pypi/proxy/python_proxy"</span>
    <span class="hljs-attr">method:</span> <span class="hljs-string">GET</span>
    <span class="hljs-attr">body_format:</span> <span class="hljs-string">raw</span>
    <span class="hljs-attr">status_code:</span> [ <span class="hljs-number">200</span>, <span class="hljs-number">202</span>, <span class="hljs-number">204</span>, <span class="hljs-number">404</span> ]
    <span class="hljs-attr">headers:</span>
      <span class="hljs-attr">Content-Type:</span> <span class="hljs-string">application/json</span>
    <span class="hljs-attr">force_basic_auth:</span> <span class="hljs-literal">true</span>
    <span class="hljs-attr">return_content:</span> <span class="hljs-literal">true</span>
  <span class="hljs-attr">any_errors_fatal:</span> <span class="hljs-literal">true</span>
  <span class="hljs-attr">register:</span> <span class="hljs-string">python_local</span>
<span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Create</span> <span class="hljs-string">PyPI</span> <span class="hljs-string">proxy</span>
  <span class="hljs-attr">tags:</span> <span class="hljs-string">pypi_proxy_create</span>
  <span class="hljs-attr">ansible.builtin.uri:</span>
    <span class="hljs-attr">user:</span> <span class="hljs-string">""</span>
    <span class="hljs-attr">password:</span> <span class="hljs-string">""</span>
    <span class="hljs-attr">url:</span> <span class="hljs-string">"/v1/repositories/pypi/proxy"</span>
    <span class="hljs-attr">method:</span> <span class="hljs-string">POST</span>
    <span class="hljs-attr">body_format:</span> <span class="hljs-string">raw</span>
    <span class="hljs-attr">status_code:</span> [ <span class="hljs-number">201</span> ]
    <span class="hljs-attr">headers:</span>
      <span class="hljs-attr">Content-Type:</span> <span class="hljs-string">application/json</span>
    <span class="hljs-attr">body:</span> <span class="hljs-string">|-
      {
        "name": "python_proxy",
        "online": true,
        "storage": {
          "blobStoreName": "default",
          "strictContentTypeValidation": true
        },
        "proxy": {
          "remoteUrl": "https://pypi.org/",
          "contentMaxAge": -1,
          "metadataMaxAge": 1440
        },
        "negativeCache": {
          "enabled": true,
          "timeToLive": 1440
        },
        "httpClient": {
          "blocked": false,
          "autoBlock": true,
          "connection": {
            "retries": 0,
            "timeout": 60,
            "enableCircularRedirects": false,
            "enableCookies": true,
            "useTrustStore": false
          }
        }
      }
</span>    <span class="hljs-attr">force_basic_auth:</span> <span class="hljs-literal">true</span>
    <span class="hljs-attr">return_content:</span> <span class="hljs-literal">true</span>
  <span class="hljs-attr">any_errors_fatal:</span> <span class="hljs-literal">true</span>
  <span class="hljs-attr">when:</span> <span class="hljs-string">python_local.status</span> <span class="hljs-string">==</span> <span class="hljs-number">404</span>
</code></pre>
<p>We are almost there. Now we need to tell our PyPi clients than we should use our local Nexus and not the direct PyPi site to get our Python libraries.</p>
<h2 id="heading-how-to-set-the-clients">How to Set the Clients</h2>
<p>The clients role is much simpler and only requires deploying a <a target="_blank" href="https://tutorials.kodegeek.com/Nexus3OnOrangePI/ansible/roles/clients/templates/pip.conf.j2">template for pip.conf</a> with enough information to force the search on our new repository:</p>
<pre><code class="lang-yaml"><span class="hljs-comment"># Tasks here are meant to be used on our clients user</span>
<span class="hljs-meta">---</span>
<span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Create</span> <span class="hljs-string">installation</span> <span class="hljs-string">directory</span> <span class="hljs-string">for</span> <span class="hljs-string">pip.conf</span>
  <span class="hljs-attr">tags:</span> <span class="hljs-string">pip_basedir</span>
  <span class="hljs-attr">ansible.builtin.file:</span>
    <span class="hljs-attr">state:</span> <span class="hljs-string">directory</span>
    <span class="hljs-attr">path:</span> <span class="hljs-string">""</span>
    <span class="hljs-attr">owner:</span> <span class="hljs-string">""</span>
    <span class="hljs-attr">group:</span> <span class="hljs-string">""</span>
    <span class="hljs-attr">mode:</span> <span class="hljs-string">"u+rwx,go-rwx"</span>
<span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Copy</span> <span class="hljs-string">pip.conf</span> <span class="hljs-string">file</span>
  <span class="hljs-attr">tags:</span> <span class="hljs-string">pip_copy</span>
  <span class="hljs-attr">ansible.builtin.template:</span>
    <span class="hljs-attr">src:</span> <span class="hljs-string">pip.conf.j2</span>
    <span class="hljs-attr">dest:</span> <span class="hljs-string">"/pip.conf"</span>
    <span class="hljs-attr">owner:</span> <span class="hljs-string">""</span>
    <span class="hljs-attr">group:</span> <span class="hljs-string">""</span>
    <span class="hljs-attr">mode:</span> <span class="hljs-string">u=rxw,g=r,o=r</span>
</code></pre>
<p>The resulting file gets deployed on ‘<em>~/.config/pip/pip.conf</em>’ of every machine:</p>
<pre><code class="lang-yaml"><span class="hljs-comment"># https://pip.pypa.io/en/stable/topics/configuration/</span>
[<span class="hljs-string">global</span>]
<span class="hljs-string">timeout</span> <span class="hljs-string">=</span> <span class="hljs-number">60</span>
[<span class="hljs-string">install</span>]
<span class="hljs-string">index</span> <span class="hljs-string">=</span> <span class="hljs-string">http://orangepi5.home:8081/repository/python_proxy/pypi</span>
<span class="hljs-string">index-url</span> <span class="hljs-string">=</span> <span class="hljs-string">http://orangepi5.home:8081/repository/python_proxy/simple/</span>
<span class="hljs-string">trusted-host</span> <span class="hljs-string">=</span> <span class="hljs-string">orangepi5.home</span>
</code></pre>
<p>The file above shows an example of how the final version of the file will look once deployed on my cluster (yours will be different with the resolved URL).</p>
<p>It is time now to run the whole playbook and see what it looks like.</p>
<h2 id="heading-how-to-run-the-playbook">How to Run the Playbook</h2>
<p>To run the playbook, we pass a few arguments:</p>
<ol>
<li><p>The location of our host inventory</p>
</li>
<li><p>The location of the encrypted password file and a master file containing the master password to unlock the contents of the protected file</p>
</li>
<li><p>And finally the location of our main playbook file</p>
</li>
</ol>
<pre><code class="lang-shell">cd ansible
ansible-playbook --inventory  inventories --extra-vars @vault/nexus_password.enc --vault-password-file $HOME/vault/ansible_vault_pass site.yaml
</code></pre>
<p><a target="_blank" href="https://asciinema.org/a/579355"><img src="https://asciinema.org/a/579355.svg" alt="asciicast" width="600" height="400" loading="lazy"></a></p>
<h3 id="heading-how-to-test-the-new-pypi-proxy">How to test the new PyPI proxy</h3>
<p>To test our new proxy, we will install <a target="_blank" href="https://github.com/Textualize/rich">Python Rich</a> using pip and a virtual environment.</p>
<pre><code class="lang-shell">josevnz@orangepi5:~$ python3 -m venv ~/virtualenv/rich
(rich) josevnz@orangepi5:~$ . ~/virtualenv/rich/bin/activate
(rich) josevnz@orangepi5:~$ pip install rich
Looking in indexes: http://orangepi5.home:8081/repository/python_proxy/simple/
Collecting rich
  Downloading http://orangepi5.home:8081/repository/python_proxy/packages/rich/13.3.4/rich-13.3.4-py3-none-any.whl (238 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 238.7/238.7 KB 14.8 MB/s eta 0:00:00
Collecting pygments&lt;3.0.0,&gt;=2.13.0
  Downloading http://orangepi5.home:8081/repository/python_proxy/packages/pygments/2.15.0/Pygments-2.15.0-py3-none-any.whl (1.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 23.8 MB/s eta 0:00:00
Collecting markdown-it-py&lt;3.0.0,&gt;=2.2.0
  Downloading http://orangepi5.home:8081/repository/python_proxy/packages/markdown-it-py/2.2.0/markdown_it_py-2.2.0-py3-none-any.whl (84 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 84.5/84.5 KB 6.9 MB/s eta 0:00:00
Collecting mdurl~=0.1
  Downloading http://orangepi5.home:8081/repository/python_proxy/packages/mdurl/0.1.2/mdurl-0.1.2-py3-none-any.whl (10.0 kB)
Installing collected packages: pygments, mdurl, markdown-it-py, rich
Successfully installed markdown-it-py-2.2.0 mdurl-0.1.2 pygments-2.15.0 rich-13.3.4
</code></pre>
<p>And then we can confirm than the cache was indeed used by seeing the new artifacts on the new repository:</p>
<p><img src="https://tutorials.kodegeek.com/Nexus3OnOrangePI/sonatype_browse_python_proxy.png" alt="New artifacts on the Python_proxy PyPI repository" width="841" height="315" loading="lazy"></p>
<p><em>See the PyPi artifacts</em></p>
<p>Let’s see a demo of the client in action, installing something else:</p>
<p><a target="_blank" href="https://asciinema.org/a/579357"><img src="https://asciinema.org/a/579357.svg" alt="asciicast" width="600" height="400" loading="lazy"></a></p>
<h2 id="heading-further-customization-using-the-rest-api">Further Customization Using the REST-API</h2>
<p>Every Nexus installation allows you to download a JSON file that describes the API supported by the server. For example, in my server you can get a copy like this from my orangepi5.home server:</p>
<pre><code class="lang-shell">curl --fail --remote-name http://orangepi5.home:8081/service/rest/swagger.json
</code></pre>
<p>Also, the UI allows you to try the other REST API endpoints to customize your installation.</p>
<p><img src="https://tutorials.kodegeek.com/Nexus3OnOrangePI/api-swagger.png" alt="API Swagger documentation on Nexus 3" width="1498" height="782" loading="lazy"></p>
<p><em>REST API testing</em></p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>I recommend spending some time and reading the <a target="_blank" href="https://help.sonatype.com/repomanager3">Nexus 3 book</a> to get yourself familiar with the features this tool can offer.</p>
<p>The community prepared <a target="_blank" href="https://github.com/sonatype-nexus-community/nexus-repository-installer">Debian and RPM installers</a>, if you need this kind of setup as opposed to using Ansible.</p>
<p>Nexus 3 <em>has lots</em> of configurable settings. We covered only the surface here. While preparing this article I found '<a target="_blank" href="https://github.com/ansible-ThoTeam/nexus3-oss">ThoTeam Nexus3-oss repository</a>' with a very complete and up-to-date playbook, but it was way more complex than anything I required for my home lab.</p>
<p><a target="_blank" href="https://archiva.apache.org/">Archiva</a> is another Open Source artifact manager, it is more limited in functionality but also simpler to setup.</p>
<p>There is a <a target="_blank" href="https://help.sonatype.com/repomanager3/installation-and-upgrades/post-install-checklist">post-installation checklist</a> with some tasks I did not need to complete for my home lab. Please check it out to make sure your setup is complete.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ What is RAM? How to Access Your Computer's RAM and Read the Contents ]]>
                </title>
                <description>
                    <![CDATA[ This article is a comprehensive guide on how to read the contents of your computer's RAM.  Random Access Memory (RAM) is a crucial component of any computer system, and it is responsible for temporarily storing data that is required by the system to ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-access-and-read-ram-contents/</link>
                <guid isPermaLink="false">66c4c5a926a77d9936ef0a61</guid>
                
                    <category>
                        <![CDATA[ Computer Science ]]>
                    </category>
                
                    <category>
                        <![CDATA[ hardware ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Gursimar Singh ]]>
                </dc:creator>
                <pubDate>Mon, 24 Apr 2023 19:31:18 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2023/04/ram-article.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>This article is a comprehensive guide on how to read the contents of your computer's RAM. </p>
<p>Random Access Memory (RAM) is a crucial component of any computer system, and it is responsible for temporarily storing data that is required by the system to carry out its functions. But the contents of RAM can be quite volatile, and they are usually lost when the system is shut down.</p>
<p>One way to preserve the contents of RAM is by performing a RAM dump, which is a process of copying the contents of RAM onto a storage device, such as a hard drive. You can analyze the RAM dump, and the data contained within it can provide valuable insights into the system's state at the time the dump was taken.</p>
<p>In this article, I will walk you through the process of reading the contents of RAM, as well as explain what a RAM dump is and how it can be useful in analyzing a computer system. I will also provide you with step-by-step instructions on how to perform a RAM dump and how to analyze the resulting data.</p>
<h2 id="heading-why-read-ram-data">Why Read RAM Data?</h2>
<p>Reading data from the disc is something you might be familiar with doing. But can we also read data straight from the RAM, where the most essential information is stored?</p>
<p>As developers, we can investigate the space complexity and delve further into the RAM to understand what is going on.</p>
<p>Accessing and reading the contents of RAM can be useful in a variety of scenarios. One common use case is for troubleshooting and diagnosing issues with a computer system. By examining the contents of RAM, you can gain insights into the state of the system at a particular point in time. </p>
<p>For example, if your computer suddenly crashes, examining the contents of RAM can help you identify the cause of the crash.</p>
<p>Another use case is for forensic analysis. When investigating a computer system for evidence of wrongdoing, examining the contents of RAM can provide valuable insights into the activities that were being carried out on the system. </p>
<p>For example, a security professional may use RAM analysis to determine whether a particular process was running on the system or to identify files that were recently accessed.</p>
<p>In addition, accessing and reading the contents of RAM can also be useful for software developers and researchers. By analyzing the data stored in RAM, developers can gain insights into the performance of their software and identify potential issues or bottlenecks. Researchers can also use RAM analysis to study the behavior of malware or to develop new security tools and techniques.</p>
<p>Overall, accessing and reading the contents of RAM can be useful for troubleshooting, forensic analysis, software development, and research. It provides a valuable way to gain insights into the inner workings of a computer system and can help identify issues and potential security threats.</p>
<p>Before we move further into the specifics, let's take a short look at the nomenclature. This may be common knowledge, but you'll need to understand the terminology as you go through this guide, so it's worth a review.</p>
<h2 id="heading-what-is-ram">What is RAM?</h2>
<p>There's a physical hardware device called RAM (which stands for Random Access Memory): the physical memory, a CPU, a hard disk, and other physical components.</p>
<p>On top of this, we have the operating system. The operating system is always in conversation with the piece of hardware known as the "kernel" – and this is one of the most critical aspects of this software.</p>
<p>If we consider things from the user's point of view, we initially log in to the operating system so that we can carry out our tasks, the majority of which include executing applications.</p>
<h3 id="heading-what-is-the-kernel">What is the Kernel?</h3>
<p>A kernel is a fundamental portion of an operating system that accepts the instructions from the user with the aid of the program we run behind the scenes. This may happen regardless of the program that we run behind the scenes.</p>
<p>Everything that has to be computed is handled by the central processing unit (CPU), but whatever we do and however we manage the services provided by the CPU, the data, instructions, code, and program must all go via the random access memory (RAM).</p>
<p>This implies that the results of anything we do with the data at any given moment in time will be available on top of the memory. If you are a programmer and you're constructing some kind of data structure, this indicates that all of the data will live on top of the RAM.</p>
<p>We can directly go to the RAM and see how the data structures have been created and how they align, and we can see how the space complexity works there.</p>
<p>For instance, if we are discussing any web browser, such as Chrome, there may have been security flaws generated in an application. So the most effective method is to navigate to the RAM and investigate how the data has been operating.</p>
<p>Let's say you open any secure website in Chrome (or any browser), like gmail.com. Any information you enter into Gmail, including your username and password, is sent over the internet to a server run by Google. That data has been fully encrypted, and it will be challenging, if not impossible, to crack the password.</p>
<p>But in order to enter your password, you likely use a computer with a keyboard attached to it. After that, some programs will encrypt the data and send it to the internet. This means that initially, your data was present in the RAM.</p>
<p>First, the password is standard data, and the password goes and lands on the top of the RAM. Then, some programs will encrypt the data and send it to the internet. If you can access the RAM, you can examine it to determine whether or not your password has been encrypted. And this process is pretty straightforward.</p>
<p>Let's look at an example to see how this works. We'll pretend that "a" is a variable and "9" is the data. When we execute the program, this data loads onto the RAM. When the program ends, the data from the RAM will be gone, although nobody has proven it yet. But this is the case, and we can prove it with a little investigation.</p>
<p>So how can we check whether or not this data is still present in the RAM after the application has finished running if it was loaded at the very top of the memory?</p>
<p>Well, the RAM will be cleared of these contents shortly. A "RAM dump" is the process of capturing all of the RAM. This demonstrates the actual form in which the entire data set is made accessible and loaded onto the RAM for the first time. And you'll learn how to capture or extract the data from memory next.</p>
<p>In order to accomplish this, you'll need some form of software. As a result, the goal of this program is to travel further into the memory. It will go into memory and retrieve all of the stored data from memory before continuing.</p>
<h3 id="heading-what-is-lime">What is LiME?</h3>
<p>The Linux memory extractor, sometimes referred to as LiME, is a powerful piece of software. It's what you use to extract the memory from Linux. This piece of software is also known as the driver, also referred to as the module. This is because RAM is a device, which complicates things further.</p>
<p>We need some form of driver to access the device so we can try to read the contents of it. LiME is an example of a driver, and if you're familiar with Linux you may know that in order to make any driver function, you need to load that driver with the assistance of the kernel.</p>
<p>Within the context of Linux, a driver is also referred to as a module. So LiME is a Linux kernel module. We have access to what is known as a kernel loadable module, which allows us to install the module on the operating system.</p>
<p>We have covered enough background. Now, let's look at how we can extract the contents of the RAM. We'll go through the process step-by-step in a hands-on way.</p>
<h2 id="heading-setup-and-installations"><strong>Setup</strong> and <strong>Installations</strong></h2>
<p>So, the only thing we need is the LiME driver. Here's the link to download this particular module: <a target="_blank" href="https://github.com/gursimarsm/LiME">https://github.com/gursimarsm/LiME</a>.</p>
<p>Now, boot up your Linux system (I use RedHat Enterprise Linux). You can use the <strong><code>free -h</code></strong> command to check the amount of RAM memory that's being used, that's available, and other details. Mine looks like this:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/image-186.png" alt="Image" width="600" height="400" loading="lazy">
<em>Output from running the <code>free -m</code> command</em></p>
<p>To access RAM, we need some software where the kernel can load some extra modules. In our case, the module name is LiME. So, the software we install are called “<strong>kernel-devel</strong>”, and “<strong>kernel-headers</strong>”. These two pieces of software are what we need to install in order to perform our subsequent actions, that is to use the LiME module.</p>
<p>If you want to install the software, you should have "yum" configured. For context, <strong>yum</strong> is a command you can use to install the software in the RedHat Linux operating system. I'll demo how to configure it in the appendix for reference.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/image-187.png" alt="Image" width="600" height="400" loading="lazy">
<em>Installation</em></p>
<p>So, now that you've installed that software, you need one more piece of software because you have to download some drivers from GitHub. So, now you need to install Git if you don't already have it. You can do this using the command <strong><code>yum install git</code></strong>. You also need to configure your account so that you can work with it.</p>
<pre><code class="lang-bash"><span class="hljs-comment"># git config --global user.name "Your Name" </span>

<span class="hljs-comment"># git config --global user.email "you@example.com"</span>
</code></pre>
<p>I shared the repository above. It's a loadable kernel module (LKM). It lets you acquire the entire memory from your Linux operating system or any kind of language operating system (including Android devices because Android is based on Linux as well).</p>
<p>You can download the module using the <code>**# g**it clone**** [**https://github.com/gursimar**sm**/LiME**](https://github.com/gursimarsm/LiME)</code> command.</p>
<p>After downloading that, you need to move into the directory of the software. You'll find multiple folders there. But, to run the main code, you need to move to the "src" directory.</p>
<p>In this directory, you'll find multiple programs based on the C language. So, in order to make use of the files, you'll need to compile them. To do that, you can use the <strong><code>make</code></strong> command. Install that like this:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># yum install make </span>

<span class="hljs-comment"># yum install gcc</span>
</code></pre>
<p>In the directory /LiME/src/, run the <strong><code>make</code></strong> command to compile the entire code.</p>
<p>If you encounter an error, it might be because we are using the latest version of LiME, and it comes with a new feature called orc metadata generate. To implement this feature, you have to install one more thing that's part of LiME called <strong><code>elfutils-libelf-devel</code></strong>. You can do that using yum like you can see below:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/image-188.png" alt="Image" width="600" height="400" loading="lazy">
<em>How to install <strong><code>elfutils-libelf-devel</code></strong></em></p>
<p>After that's done, if we now run the <code>make</code> command it will ask the GCC compiler to compile the entire code. After the compilation, it will create one final object file called the kernel object file, and that is the final module in LiME.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/image-189.png" alt="Image" width="600" height="400" loading="lazy">
<em>Output</em></p>
<p>You can find this file in the same directory by using the <strong><code>ls</code></strong> command.</p>
<h2 id="heading-how-to-use-the-module"><strong>How to Use the Module</strong></h2>
<p>With this module, the kernel now has the capability to capture or read the entire RAM. By default, we can't read the entire RAM in one go, but now because of the LiME module, we can.</p>
<p>To learn more about the LiME module, you can use the <strong><code>modinfo</code></strong> command. Type <code>modinfo</code> along with <code>lime</code>. This will show you some more details like where the file is available, and it also displays all the modules or drivers that come with some kind of extra parameters. Every parameter has some benefits.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/image-190.png" alt="Image" width="600" height="400" loading="lazy">
<em>modinfo</em></p>
<p>Here we are going to use two parameters which are very important: <code>path</code> and <code>format</code>.</p>
<p><code>path</code> means when we read the entire RAM, we have to store the data of the RAM in some file. So, to specify the destination file we would like to create, we have to give that particular information over here.</p>
<p>The next parameter, <code>format</code>, specifies the format in which we want to read the RAM data. So, in this case, we want to read the format of the RAM as it is. The data stored in the RAM is mostly in binary, and we want to read the entire data in that binary format only and capture it in its raw form.</p>
<p>So, the format will be raw and stored in the file wherever we give the path.</p>
<p>Finally, it's time to read the data from the RAM. So, let's come to the main command that will help us start reading the entire RAM.</p>
<h3 id="heading-demonstration">Demonstration</h3>
<p>Type in your password for your Gmail account in Chrome for this demonstration. This will help you learn how to capture the data from the RAM and also if your password is encrypted.</p>
<p>To verify these two things, move to the command prompt and check if the data is still on the RAM. You'll have to load a particular module using the command <strong><code>insmod</code></strong>. This will help you insert the module.</p>
<p>Copy the complete path of the module and paste it along with the <code>insmod</code> command.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/image-191.png" alt="Image" width="600" height="400" loading="lazy">
<em><code>insmod</code> command</em></p>
<p>This module will get loaded with the help of the kernel. The module will start capturing the entire data from the RAM and it'll store it in a file, for example, myram.data</p>
<p>It will also load the entire memory dump or RAM dump into this file and which format we want to capture. So, the format will be the raw format.</p>
<p>We'll use these two parameters (don't worry about this for now). We need only two parameters to perform, and now as soon as we hit this command, whatever data we have will be captured and stored in this particular file. This command typically takes a few seconds, depending on the CPU speed and the amount of data we have in the RAM.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/image-192.png" alt="Image" width="600" height="400" loading="lazy">
<em>Command</em></p>
<h3 id="heading-how-to-read-the-data">How to read the data</h3>
<p>Now, we have this file myram.data and the entire data of the RAM is stored in this file. Because we captured this data in the raw format, the data is going to be in binary. If we try to read this data from this file directly, as human beings, we can't read it even if we try it with the initial lines using the head command to read some of the top 10 lines.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/image-193.png" alt="Image" width="600" height="400" loading="lazy">
<em>Output</em></p>
<p>So, we can use the “cat” command, which will read the entire data. But, again, the same thing is going to happen – it will read the entire data, but the data will be displayed in the binary format. Then we need to use the pipe function with this command and combine it with another new command called <code>strings</code>:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/image-194.png" alt="Image" width="600" height="400" loading="lazy">
<em>Command</em></p>
<p>String is a command that will convert the data into regular text in a human-readable format.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/image-195.png" alt="Image" width="600" height="400" loading="lazy">
<em>Output</em></p>
<p>The list will go on and on. You can interrupt it using <strong>Ctl+C</strong>.</p>
<p>Right now, it won't mean much seeing and reading the entire data. We know some data that are there on the RAM is the password called mywebpasswordgmail. So, just to confirm that this data is available on the RAM we can use one more pipe along with the <code>grep</code> command. The grep command helps us sort the data.</p>
<pre><code class="lang-bash">cat /myram.data | strings | grep mywebpasswordgmail
</code></pre>
<p>Now, we are searching for this string in the entire data. It will convert the data into regular text, and wherever that particular string shows up, grep will grab that line and let us start searching, then show us this data.</p>
<p>So, as you can see from this simple example, whatever you type on your keyboard can also go into the RAM – even if it's your password or any kind of secure site you are surfing, your data is there on the RAM. It doesn't matter what program you run. If you type using the keyboard everything will load on the RAM and can be extracted. This is called the memory dump.</p>
<p>LiME provides us with many other powerful capabilities. Right now, we are capturing the data directly from the system where we perform the actions. But we can also run LiME on the system and it can capture the data in real-time and send the data over the network to another computer.</p>
<p>What does this mean? Think of it this way: for example, somebody opens a website and they're typing something in real-time. This entire message is being transmitted in real-time to another computer.</p>
<p>We're not talking about key loggers, we are just talking about the RAM. Whatever is happening when any program is running, the database is storing some data. Programs are reading data from other parts of the hard disk. And whatever is happening on the RAM can be captured in real-time by the system and sent over the network to other computers.</p>
<h1 id="heading-conclusion">Conclusion</h1>
<p>We’ve finally come to the end of this article. I hope you've enjoyed it and have learned something new.</p>
<p>I’m always open to suggestions and discussions on <a target="_blank" href="https://www.linkedin.com/in/gursimarsm">LinkedIn</a>. Hit me up with direct messages.</p>
<p>If you’ve enjoyed my writing and want to keep me motivated, consider leaving starts on <a target="_blank" href="https://github.com/gursimarsm">GitHub</a> and endorse me for relevant skills on <a target="_blank" href="https://www.linkedin.com/in/gursimarsm">LinkedIn</a>.</p>
<p>Till the next one, stay safe and keep learning.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ What is Firmware? Definition and Examples ]]>
                </title>
                <description>
                    <![CDATA[ Did you know that firmware is literally everywhere? It might be strange to think about – but it's just as common as hardware and software. In fact, it is thanks to firmware that: Printers work Defibrillators work Car radios works and more … Based o... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/what-is-firmware/</link>
                <guid isPermaLink="false">66ba536002e3361751683723</guid>
                
                    <category>
                        <![CDATA[ firmware ]]>
                    </category>
                
                    <category>
                        <![CDATA[ hardware ]]>
                    </category>
                
                    <category>
                        <![CDATA[ software ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Tiago Capelo Monteiro ]]>
                </dc:creator>
                <pubDate>Thu, 21 Apr 2022 18:40:08 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/04/postimage.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Did you know that firmware is literally everywhere? It might be strange to think about – but it's just as common as hardware and software.</p>
<p>In fact, it is thanks to firmware that:</p>
<ul>
<li>Printers work</li>
<li>Defibrillators work</li>
<li>Car radios works</li>
<li>and more …</li>
</ul>
<p>Based on the examples above, you probably already have some idea of what firmware is. But you don't have a clear definition of it.</p>
<p>In order to truly understand what firmware is, we must first understand software, then hardware, and finally we can jump into firmware.</p>
<p>In this tutorial, I'll explain each topic with an analogy. By doing so, everyone can understand.</p>
<p>It doesn't matter if you're just getting into technology!</p>
<p>With that, I would like to make sure that everyone understands what software, hardware, and firmware is. I will not elaborate on the technical terms.</p>
<h3 id="heading-in-this-article-we-will-explore">In this article we will explore:</h3>
<ul>
<li>What exactly is software?</li>
<li>What exactly is hardware?</li>
<li>What exactly is firmware?</li>
</ul>
<h2 id="heading-what-is-software">What is Software?</h2>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/03/book.jpeg" alt="Image" width="600" height="400" loading="lazy">
_Photo by [<strong>Pexels</strong>](https://www.pexels.com/@kubra-dogu-80605500?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels" rel="noopener"&gt;<strong>Kübra Doğu</strong> from &lt;a href="https://www.pexels.com/photo/food-wood-dawn-coffee-9222655/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm<em>source=pexels" rel="noopener)</em></p>
<p>Imagine, if you will, that you have no idea what to make for dinner today.</p>
<p>Luckily, you find an old cookbook you have and decide to cook one of the recipes in it.</p>
<p>The cookbook has many recipes. Each of these recipes has its own instructions.</p>
<p>In the <strong>cookbook</strong>, a <strong>recipe</strong> can be seen as a <strong>set of steps</strong> (or instructions) that together make a <strong>meal</strong>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/04/cooking-instruction.jpg" alt="Image" width="600" height="400" loading="lazy">
<em>Photo by <a target="_blank" href="https://www.pexels.com/photo/open-bible-2294878/">Luis Quintero on Pexels</a></em></p>
<p>You can also create your own meals based on your experience in cooking many different recipes, right?</p>
<p>Software is no different.</p>
<p><strong>Software programs</strong> can be seen as a <strong>set of instructions</strong> that work together to form a <strong>program</strong>.</p>
<pre><code class="lang-assembly"> global  _main
    extern  _printf

    section .text
_main:
    push    message
    call    _printf
    add     esp, 4
    ret
message:
    db  'Hello, World', 10, 0
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/04/HelloWorld.asm.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Then, applications are a big sets of instructions that perform specific tasks.</p>
<p>Operating systems are big sets of instructions that coordinate software and hardware resources.</p>
<ul>
<li>Cookbook = software</li>
<li>Dinner cookbook = type of software (application or operating system)</li>
<li>Recipe = program</li>
</ul>
<p>You need a recipe to make dinner. You must follow each step in the cookbook to create a recipe.</p>
<p>Once you have completed all the steps, your dinner is ready.</p>
<p>You need software to accomplish a particular task. A computer has to follow all instructions for the software to function. </p>
<p>Therefore, the software is running either while the instructions are being followed or after they have been completed.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/04/recipie---cooking-instructions.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-what-is-hardware">What is Hardware?</h2>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/03/food.jpeg" alt="Image" width="600" height="400" loading="lazy">
_Photo by [<strong>Pexels</strong>](https://www.pexels.com/@elevate?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels" rel="noopener"&gt;<strong>ELEVATE</strong> from &lt;a href="https://www.pexels.com/photo/chef-preparing-vegetable-dish-on-tree-slab-1267320/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm<em>source=pexels" rel="noopener)</em></p>
<p>In order to make dinner, you need a series of steps from the cookbook that tell you how to make a particular meal.</p>
<p>You also need various tools to cook with - like pots and pans, knives, and the food itself. This is like hardware.</p>
<p>So a cookbook gives you instructions that allow you to cook.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/04/cooking-process-1.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>For hardware to work, it needs software (a set of instructions) to tell it what to do.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/04/CPU-process-2.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Software then, gives instructions to hardware that lets it work.</p>
<ul>
<li>Meal prep tools = hardware</li>
<li>Recipe = software</li>
</ul>
<p>Without software, you can't make hardware work.</p>
<p>Without a recipe, you won't know what to do with your various tools and ingredients to make a meal.</p>
<p>Like hardware without software, you can also eat a meal with just uncooked food. Gross.</p>
<p>In the same way that there are various types of meals, there are also various types of computer hardware.</p>
<p>For example:</p>
<ul>
<li>CPU</li>
<li>RAM</li>
<li>GPU</li>
<li>and so much more…</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/04/comparason-of-processes.png" alt="Image" width="600" height="400" loading="lazy">
<em>Comparison of processes</em></p>
<h2 id="heading-what-is-firmware">What is Firmware?</h2>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/03/dessert.jpeg" alt="Image" width="600" height="400" loading="lazy">
_Photo by [<strong>Pexels</strong>](https://www.pexels.com/@ella-olsson-572949?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels" rel="noopener"&gt;<strong>Ella Olsson</strong> from &lt;a href="https://www.pexels.com/photo/close-up-photo-of-chocolate-mousse-3026810/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm<em>source=pexels" rel="noopener)</em></p>
<p>A program is a set of instructions read by a computer.</p>
<p>Let's say you just want to make a snack or dessert. You probably don't need as many ingredients as when making a dinner for your family, right?</p>
<p>Let's say you want software that runs on a microwave. You don't need all the hardware the computer has to make the microwave work, right? You just need that specific to making the microwave work.</p>
<p>Or say you want software running on a printer. You don't need all the hardware the computer has to make the printer work right? Just the software for the printer.</p>
<ul>
<li>Microwave software = firmware</li>
<li>Printers software = firmware</li>
</ul>
<p>So this means that firmware is nothing more than software, but in a hardware device. Not in a computer.</p>
<p>Firmware lets very specific hardware complete very specific tasks.</p>
<h2 id="heading-wrapping-up">Wrapping up</h2>
<p>Thanks for reading! Now you know more about:</p>
<ul>
<li>Software</li>
<li>Hardware</li>
<li>Firmware</li>
</ul>
<p>Microprocessor photo by <strong><a target="_blank" href="https://www.pexels.com/@pok-rie-33563?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Pok Rie</a></strong> from <strong><a target="_blank" href="https://www.pexels.com/photo/dell-motherboard-and-central-processing-unit-1432675/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Pexels</a></strong> </p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Types of Hard Drives – SATA, PATA, SCSI, and SSD ]]>
                </title>
                <description>
                    <![CDATA[ A hard drive is a non-volatile hardware component on a computer that acts as the storage for all digital content. It holds program files, documents, pictures, videos, music, and more. The non-volatile nature of hard drives means they don’t lose data,... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/types-of-hard-drives-sata-pata-scsi-and-more-2/</link>
                <guid isPermaLink="false">66adf2418c7074f6c4885238</guid>
                
                    <category>
                        <![CDATA[ hardware ]]>
                    </category>
                
                    <category>
                        <![CDATA[ storage ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Kolade Chris ]]>
                </dc:creator>
                <pubDate>Mon, 04 Apr 2022 23:17:35 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/04/hard-drive-1110813_1280.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>A hard drive is a non-volatile hardware component on a computer that acts as the storage for all digital content. It holds program files, documents, pictures, videos, music, and more.</p>
<p>The non-volatile nature of hard drives means they don’t lose data, even if power is lost. Due to this, they help computers store files and other data for a long time – as long as they don’t get damaged or corrupted.</p>
<p>Since the first release of hard drives by IBM in 1956, hard drives have evolved from being the size of a refrigerator and having a storage capacity of just 5MB to ones that are pocket-sized and have up to 4 TB of storage capacity.</p>
<p>In this article, I will cover the different types of hard drives so you can choose the best for your computer.</p>
<p>But firstly, let's look at interfaces – the connecting part between the computer and the hard drive.</p>
<h2 id="heading-types-of-interfaces">Types of Interfaces</h2>
<ul>
<li>Parallel Advanced Technology Attachment (PATA)</li>
<li>Serial Advanced Technology Attachment (SATA)</li>
<li>Small Computer System Interface (SCSI)</li>
<li>NVMe (Non-volatile Memory Express)</li>
</ul>
<p>These names come from the way they connect to the computer. So, there are PATA hard drives, SATA hard drives, SCSI hard drives, and NVMe drives.</p>
<p>In this article, I’m now going to elaborate on each of these interfaces and types of hard drives as concisely as possible.</p>
<h3 id="heading-parallel-advanced-technology-attachment-pata">Parallel Advanced Technology Attachment (PATA)</h3>
<p>The PATA interfaces were first introduced to the market by Compaq and Western Digital in 1986. They can have up to 80GB capacity and transfer data as fast as 133 MB/S.</p>
<p>They were named Parallel Advanced Technology Attachment because they use a parallel ATA interface to connect to the computer. Apart from PATA, they are also called Integrated Drive Electronics (IDE) and Enhanced Integrated Drive Electronics (EIDE).</p>
<p>PATA interfaces are made of mechanical moving parts and are based on parallel signaling technology – meaning they transmit multiple bits of data simultaneously.</p>
<h3 id="heading-serial-advanced-technology-attachment-sata">Serial Advanced Technology Attachment (SATA)</h3>
<p>In recent times, a lot of desktop and laptop computers have gotten SATA interfaces because they have superseded PATA interfaces in size, power consumption, and even better pricing.</p>
<p>The mode of connection to a computer remains the same as PATA, but instead of parallel signaling technology for data transmission, they use serial signaling technology. This means that they transfer data one bit at a time.</p>
<p>A notable advantage SATA interfaces have over PATA interfaces is the transmission of data at a rate of 150 – 300 MB/S. In addition, they have thinner cables and a cable limit of 1 meter.</p>
<h3 id="heading-small-computer-system-interface-scsi">Small Computer System Interface (SCSI)</h3>
<p>SCSI interface is an upgrade over SATA and PATA interfaces for many reasons such as round-the-clock operations, speed, storage, and several others.</p>
<p>For connection, SCSI hard drives use a small computer system interface – which is a standard for connecting peripheral devices such as printers, scanners, and others.</p>
<p>Best of all, they allow the connection of peripheral devices such as printers, scanners, and other hard drives. In addition, they transmit data at 320 MB/S and you can connect them internally or externally.</p>
<p>Connections through SCSI on personal computers have now been replaced by the Universal Serial BUS (USB). This means that SCSI is no longer used as consumer hardware.</p>
<h3 id="heading-nvme-non-volatile-memory-express">NVMe (Non-volatile Memory Express)</h3>
<p>NVMe interface is a revolution. It is built for high demanding and computing-intensive tasks So, it is an upgrade over the interfaces already discussed.</p>
<p>Because of its high performance and scalability, you'll find it mostly in data centers and newer computers. There are now SSDs using the NVMe interface.</p>
<p>Its many advantages over other interfaces are:</p>
<ul>
<li>lower power consumption</li>
<li>multiple command queues</li>
<li>reduced latency and input/output overhead – leading to better performance</li>
<li>utilization of CPU to full potential</li>
</ul>
<p>One of the disadvantages of NVMe interfaces is that they're more expensive than other interfaces.</p>
<h2 id="heading-types-of-hard-drives">Types of Hard Drives</h2>
<p>Currently, there are two common types of hard drive:</p>
<ul>
<li>Hard Disk Drive (HDD)</li>
<li>Solid State Drive (SSD)</li>
</ul>
<p>A hard drive utilizes any of the interfaces such as PATA, SATA, SCSI. Today, there are SSDs that utilize the NVMe interface.</p>
<p>Let's look at the two types of hard drives in detail.</p>
<h3 id="heading-hard-disk-drive-hdd">Hard Disk Drive (HDD)</h3>
<p>Hard disk drives are not that new and you will find them installed in older computers. They consist of a moving part that rotates during reading and writing operations, so they usually make noise.</p>
<p>These days, you may not see many newer desktop and laptop computers with hard disk drives, but they remain popular because of their storage space. 16 GB, 32 GB, and 64 GB are the lowest you can find out there. There are 500 GB, 1 TB, 2TB, and more than 4 TB hard drives.</p>
<p>This enormous storage space is the reason hard disk drives may go nowhere any time soon. There are even external hard disk drives you can use to backup your files.</p>
<h3 id="heading-solid-state-drive-ssd">Solid State Drive (SSD)</h3>
<p>SSD hard drives are one of the latest hard drive technologies at the time of writing this article. Most newer computers have SSDs instead of HDDs.</p>
<p>Unlike the hard drive technologies before SSD drives, they don’t consist of moving parts and they don’t use magnetism for storing data. So, they don't make noise like hard disk drives (HDDs).</p>
<p>Instead, they use integrated circuits (ICs) just like third-generation computers. This makes them more durable, faster, and less prone to damage and corruption.</p>
<p>SSD hard drives have a notable advantage of transferring data at speed of 550 MB/S and allow faster boot times than the types of hard drives before them.</p>
<p>Solid state drives also have enormous sizes, but they are very expensive when compared to hard disk drives.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>This article explained what different types of hard drives are and how they work, so you can learn more about hard drives and choose the best one for your needs.</p>
<p>From PATA to SATA, SCSI and NVMe, hard drive interfaces continue to evolve and research to make better ones is ongoing.</p>
<p>There is a new variation of SSD hard drives called NVMe (Non-volatile Memory Express) SSDs that has the capacity to transfer data as fast as 3.5 GB/S. This makes them the best choice for video editing and high-resolution gaming, though they require more power than the actual SSDs.</p>
<p>Thank you for reading.</p>
<p>If you find this article helpful, don’t hesitate to share it with your friends and family.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ SSD Solid State Drive Definition ]]>
                </title>
                <description>
                    <![CDATA[ An SSD, or solid state drive, is a type of storage device for computers. They are sometimes called a solid state device or solid state disk, even though they have no moving parts. Like USB flash drives, SSDs use flash memory to store data. This type ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/ssd-solid-state-drive-definition/</link>
                <guid isPermaLink="false">66c35fb7add0807b8e3fb92b</guid>
                
                    <category>
                        <![CDATA[ Computers ]]>
                    </category>
                
                    <category>
                        <![CDATA[ hardware ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Tech Terms ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Wed, 21 Apr 2021 09:29:00 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/04/jakob-owens-hvBHiIe6dMw-unsplash.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>An SSD, or solid state drive, is a type of storage device for computers. They are sometimes called a solid state device or solid state disk, even though they have no moving parts.</p>
<p>Like USB flash drives, SSDs use flash memory to store data. This type of storage means that SSDs are very fast, silent, and resistant to shock.</p>
<p>While SSDs have come down in price, they are still much more expensive and often have lower capacities than HDDs (hard disk drives). </p>
<p>SSDs are often inside a computer attached to the motherboard. But there are some external SSDs that connect to the computer with a USB cable.</p>
<p>SSDs are a non-volatile type of storage. This means that, unlike RAM, SSDs will retain any data that's written to them, even after the computer is shut down.</p>
<h2 id="heading-related-tech-terms">Related Tech Terms:</h2>
<ul>
<li><a target="_blank" href="https://www.freecodecamp.org/news/hdd-hard-disk-drive-definition/">HDD Solid State Drive Definition</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/ram-definition/">RAM Definition</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/pram-definition/">PRAM Definition</a></li>
</ul>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ HDD Hard Disk Drive Definition ]]>
                </title>
                <description>
                    <![CDATA[ An HDD, or hard disk drive, is a type of storage device for computers. They are sometimes called a hard disk, hard drive, or fixed drive. HDDs consist of one or more magnetic platters sealed in an air-tight casing to protect it from dust. There is a ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/hdd-hard-disk-drive-definition/</link>
                <guid isPermaLink="false">66c34c3393db2451bd441472</guid>
                
                    <category>
                        <![CDATA[ Computers ]]>
                    </category>
                
                    <category>
                        <![CDATA[ hardware ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Tech Terms ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Wed, 21 Apr 2021 08:27:00 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/04/denny-muller-1qL31aacAPA-unsplash.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>An HDD, or hard disk drive, is a type of storage device for computers. They are sometimes called a hard disk, hard drive, or fixed drive.</p>
<p>HDDs consist of one or more magnetic platters sealed in an air-tight casing to protect it from dust. There is a magnetic head attached to an arm that moves across the rotating platter and writes data to it. The same magnetic head can also read data that was written to the disk.</p>
<p>HDDs are often inside a computer attached to the motherboard, or in an external case connected by a USB cable.</p>
<p>While HDDs are much slower than modern SSDs (solid state drives), they can have higher capacities, and are often cheaper. Because storage is cheaper for HDDs, they are often used to store data that isn't used often, or as long term backup.</p>
<p>HDDs are a non-volatile type of storage. This means that, unlike RAM, HDDs will retain any data that's written to them, even after you shut down the computer.</p>
<h2 id="heading-related-tech-terms">Related Tech Terms:</h2>
<ul>
<li><a target="_blank" href="https://www.freecodecamp.org/news/ssd-solid-state-drive-definition/">SSD Solid State Drive Definition</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/ram-definition/">RAM Definition</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/pram-definition/">PRAM Definition</a></li>
</ul>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ RAM Definition ]]>
                </title>
                <description>
                    <![CDATA[ RAM, or random access memory, is a special type of computer memory. RAM stores important information that the computer needs to access often so that everything runs smoothly. All modern computers and phones need some amount of RAM to function. Though... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/ram-definition/</link>
                <guid isPermaLink="false">66c35d4556d1719c395f319f</guid>
                
                    <category>
                        <![CDATA[ Computers ]]>
                    </category>
                
                    <category>
                        <![CDATA[ hardware ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Tech Terms ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Wed, 21 Apr 2021 07:11:00 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/04/harrison-broadbent-ING1Uf1Fc30-unsplash.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>RAM, or random access memory, is a special type of computer memory.</p>
<p>RAM stores important information that the computer needs to access often so that everything runs smoothly. All modern computers and phones need some amount of RAM to function.</p>
<p>Though computers and other devices have other forms of storage like an HDD (hard disk drive) or SSD (solid state drive), RAM is much faster. In fact, RAM is about 30 times faster than modern SSDs.</p>
<p>While RAM is very fast, it is a type of volatile memory. This means that it only stores information while the computer is on. Unlike an HDD or SSD, once you shut down your computer, everything stored in RAM is lost.</p>
<h2 id="heading-related-tech-terms">Related Tech Terms:</h2>
<ul>
<li><a target="_blank" href="https://www.freecodecamp.org/news/pram-definition/">PRAM Definition</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/hdd-hard-disk-drive-definition/">HDD Hard Disk Drive Definition</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/ssd-solid-state-drive-definition/">SSD Solid State Drive Definition</a></li>
</ul>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ PRAM Definition ]]>
                </title>
                <description>
                    <![CDATA[ PRAM, or parameter random access memory, is a special type of battery powered RAM for older Mac computers. Modern Mac computers don't use PRAM. Instead, they use NVRAM, or non-volatile random access memory. But PRAM and NVRAM serve the same function.... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/pram-definition/</link>
                <guid isPermaLink="false">66c35cbfb8711219e1e72dc3</guid>
                
                    <category>
                        <![CDATA[ Computers ]]>
                    </category>
                
                    <category>
                        <![CDATA[ hardware ]]>
                    </category>
                
                    <category>
                        <![CDATA[ mac ]]>
                    </category>
                
                    <category>
                        <![CDATA[ macOS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Tech Terms ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Wed, 21 Apr 2021 06:05:00 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/04/julian-hochgesang-dc-I7GCibzs-unsplash.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>PRAM, or parameter random access memory, is a special type of battery powered RAM for older Mac computers.</p>
<p>Modern Mac computers don't use PRAM. Instead, they use NVRAM, or non-volatile random access memory.</p>
<p>But PRAM and NVRAM serve the same function. They both store some important information about your system like the startup disk, timezone, and so on.</p>
<p>If you're having some issues with your Mac computer, you may want to reset the PRAM / NVRAM. Here's how to do that:</p>
<ol>
<li>Shut down your Mac computer</li>
<li>Turn on the computer, and immediately hold down these keys: Option + Command + P + R</li>
<li>Hold down the keys until you hear the startup sound after about 20 seconds</li>
</ol>
<p>Here's a video that goes over how to reset the PRAM / NVRAM and SMC (system management controller):</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/N5laIcLMnJU" 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-related-tech-terms">Related Tech Terms:</h2>
<ul>
<li><a target="_blank" href="https://www.freecodecamp.org/news/macintosh-definition/">Macintosh Definition</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/ram-definition/">RAM Definition</a></li>
</ul>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ CPU Definition ]]>
                </title>
                <description>
                    <![CDATA[ A CPU, or central processing unit, is the brain of the computer. Like a human brain, the CPU controls all the functions of the computer. The CPU's job is to listen for input data from devices like a mouse or other software. Then it looks up instructi... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/cpu-definition/</link>
                <guid isPermaLink="false">66c347e912c88d894ffd1f60</guid>
                
                    <category>
                        <![CDATA[ Computers ]]>
                    </category>
                
                    <category>
                        <![CDATA[ cpu ]]>
                    </category>
                
                    <category>
                        <![CDATA[ hardware ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Tech Terms ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Tue, 06 Apr 2021 06:35:00 +0000</pubDate>
                <media:content url="https://cdn-media-2.freecodecamp.org/w1280/60753bc2776bd507fe31ed0c.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>A CPU, or central processing unit, is the brain of the computer.</p>
<p>Like a human brain, the CPU controls all the functions of the computer.</p>
<p>The CPU's job is to listen for input data from devices like a mouse or other software. Then it looks up instructions for that data, and executes those instructions.</p>
<p>For example, if you type the character "a" on your computer, your CPU will look up how to handle your button press. Once it receives instructions back, it executes your button press, and sends out the output "a".</p>
<p>Modern CPUs can handle billions, or even trillions of these instructions per second.</p>
<p>CPUs are made up of tens of thousands of tiny rods called transistors. Each transistor has either an on (yes) or off (no) state, and form the basis of binary that all computers work with.</p>
<p>With enough transistors asking these simple yes/no questions, the CPU can perform complex tasks.</p>
<p>Modern CPUs are often made up of different cores that make it easier to multitask. Each core is just another CPU on the same chip. </p>
<p>For example, a dual-core CPU has two CPUs on the same chip. These days there are quad-core (4), hexa-core (6), or even hexadeca-core (16) CPUs.</p>
<p>Modern CPUs can also use a process called multi-threading or hyper-threading to be more efficient. This is the process of splitting a CPU up into virtual cores called threads.</p>
<p>For example, if you have a dual-core processor, you might see four cores if you check your computer's system monitor.</p>
<p>These physical cores and virtual cores / threads can make your computer much faster in some cases.</p>
<p>Games usually work better on a single, powerful core. But other programs like video editing software is much faster with more cores and threads.</p>
<p>Check out this video for a high-level overview of how the CPU handles all the inputs and outputs for your computer:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/04/image-48.png" alt="Image" width="600" height="400" loading="lazy"></p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/AkFi90lZmXA" 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-related-tech-terms">Related Tech Terms:</h2>
<ul>
<li><a target="_blank" href="https://www.freecodecamp.org/news/hardware-definition/">Hardware Definition</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/operating-system-os-definition/">Operating System Definition</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/boolean-definition/">Boolean Definition</a></li>
</ul>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ LCD Definition ]]>
                </title>
                <description>
                    <![CDATA[ LCD, or Liquid Crystal Display, is a type of display that uses liquid crystals to show images. LCD is a generic term for this type of display, which can come in the form of TVs or computer monitors. LCDs work by using a combination of a backlight, po... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/lcd-definition/</link>
                <guid isPermaLink="false">66c359917ef110ecbf367b38</guid>
                
                    <category>
                        <![CDATA[ Computers ]]>
                    </category>
                
                    <category>
                        <![CDATA[ hardware ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Tech Terms ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Thu, 01 Apr 2021 02:57:00 +0000</pubDate>
                <media:content url="https://cdn-media-2.freecodecamp.org/w1280/606d1f94d5756f080ba9561f.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>LCD, or Liquid Crystal Display, is a type of display that uses liquid crystals to show images.</p>
<p>LCD is a generic term for this type of display, which can come in the form of TVs or computer monitors.</p>
<p>LCDs work by using a combination of a backlight, polarizers, liquid crystals, and color filters. By adjusting the amount of electricity the goes to the liquid crystals, the LCD can control the color of each pixel.</p>
<p>Here's a video that breaks down this process:</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/0B79dGR19Tg" 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-related-tech-terms">Related Tech Terms:</h2>
<ul>
<li><a target="_blank" href="https://www.freecodecamp.org/news/hardware-definition/">Hardware Definition</a></li>
</ul>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Hardware Definition ]]>
                </title>
                <description>
                    <![CDATA[ Hardware, or computer hardware, describes the physical parts of a computer system. Things like the CPU (central processing unit), RAM (random access memory), motherboard, and case are all considered hardware. Computer hardware can also include things... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/hardware-definition/</link>
                <guid isPermaLink="false">66c34c219972b7c5c7624e7b</guid>
                
                    <category>
                        <![CDATA[ Computers ]]>
                    </category>
                
                    <category>
                        <![CDATA[ hardware ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Tech Terms ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Thu, 01 Apr 2021 02:35:00 +0000</pubDate>
                <media:content url="https://cdn-media-2.freecodecamp.org/w1280/606d16d3d5756f080ba955de.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Hardware, or computer hardware, describes the physical parts of a computer system.</p>
<p>Things like the CPU (central processing unit), RAM (random access memory), motherboard, and case are all considered hardware. Computer hardware can also include things that are not required for the computer to function, like a monitor and mouse.</p>
<p>The term hardware is often contrasted with software.</p>
<p>Software refers to collections of instructions and/or data that run on hardware. Software is "soft" in the sense that it can be rewritten.</p>
<p>Computer hardware is "hard" because it's physical, and is difficult to change once it's been produced.</p>
<h2 id="heading-related-tech-terms">Related Tech Terms:</h2>
<ul>
<li><a target="_blank" href="https://www.freecodecamp.org/news/software-definition/">Software Definition</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/lcd-definition/">LCD Definition</a></li>
</ul>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
