<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Al Ameen S</title>
    <description>The latest articles on DEV Community by Al Ameen S (@alameens).</description>
    <link>https://dev.to/alameens</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4132717%2Fedde9abc-108b-46f0-bf59-7fe25d8107c7.jpeg</url>
      <title>DEV Community: Al Ameen S</title>
      <link>https://dev.to/alameens</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alameens"/>
    <language>en</language>
    <item>
      <title>HDD vs SSD: From Clicking Save to the Physics of Storing a Single Bit</title>
      <dc:creator>Al Ameen S</dc:creator>
      <pubDate>Sun, 01 Nov 2026 18:03:45 +0000</pubDate>
      <link>https://dev.to/alameens/hdd-vs-ssd-from-clicking-save-to-the-physics-of-storing-a-single-bit-n3c</link>
      <guid>https://dev.to/alameens/hdd-vs-ssd-from-clicking-save-to-the-physics-of-storing-a-single-bit-n3c</guid>
      <description>&lt;p&gt;&lt;em&gt;Ever wondered what actually happens inside your computer when you click Save? Discover how HDDs use magnetism, how SSDs use electrical charge, and how both technologies preserve your data.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe6jrrq0pvq267xo1rkh3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe6jrrq0pvq267xo1rkh3.png" alt=" " width="800" height="782"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You write a few lines in a text editor, click &lt;strong&gt;Save&lt;/strong&gt;, and close the application.&lt;/p&gt;

&lt;p&gt;The next day, you open the file, and your text is still there.&lt;/p&gt;

&lt;p&gt;But how did your computer preserve that information after the power was turned off?&lt;/p&gt;

&lt;p&gt;The answer begins with digital data but ends with physics.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;Hard Disk Drive (HDD)&lt;/strong&gt; stores information using magnetic patterns on rotating platters. A &lt;strong&gt;Solid-State Drive (SSD)&lt;/strong&gt; stores information using electrical states in semiconductor memory cells.&lt;/p&gt;

&lt;p&gt;Both devices perform the same fundamental job: storing data without requiring continuous power.&lt;/p&gt;

&lt;p&gt;However, the physical mechanisms they use are very different.&lt;/p&gt;

&lt;p&gt;To understand those differences, let's follow a file from the moment you click Save to the physical process that stores its data—and then retrieve it again.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. What Happens When You Click Save?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj5z9w8oqb3aovd7a805m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj5z9w8oqb3aovd7a805m.png" alt=" " width="659" height="615"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Imagine creating a text file named &lt;code&gt;notes.txt&lt;/code&gt; containing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ABC
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your computer represents these characters as bytes.&lt;/p&gt;

&lt;p&gt;For example, using UTF-8 encoding:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A = 65 = &lt;code&gt;01000001&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;B = 66 = &lt;code&gt;01000010&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;C = 67 = &lt;code&gt;01000011&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The computer does not need to understand the meaning of these characters to store them. It needs to preserve the encoded bytes and retrieve them later.&lt;/p&gt;

&lt;p&gt;But how do these bytes reach the storage device?&lt;/p&gt;

&lt;h3&gt;
  
  
  From the Application to the Storage Device
&lt;/h3&gt;

&lt;p&gt;When you click Save, several software and hardware components work together.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Application:&lt;/strong&gt; The text editor requests that the file be saved.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Operating System:&lt;/strong&gt; The operating system handles the file operation and coordinates access to storage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;File System:&lt;/strong&gt; The file system manages file names, directories, metadata, and the logical locations used to store file contents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Storage Driver and Interface:&lt;/strong&gt; Storage commands and data are sent to the selected device.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Storage Controller:&lt;/strong&gt; The drive receives the request and manages the physical storage operation.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The operating system generally works with logical block addresses. Think of these as numbered locations that the storage device exposes to the computer.&lt;/p&gt;

&lt;p&gt;The drive handles the details of locating those blocks on its physical storage medium.&lt;/p&gt;

&lt;p&gt;This separation is important. The operating system does not need to know whether the storage device uses magnetism or electrical charge.&lt;/p&gt;

&lt;p&gt;The same logical storage request can be handled by an HDD or an SSD.&lt;/p&gt;

&lt;p&gt;Now let's look at what happens inside an HDD.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Inside an HDD: The Components
&lt;/h2&gt;

&lt;p&gt;An HDD is a mechanical and electronic device. Its components work together to record and retrieve data from rotating magnetic surfaces.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzyqb2szu1vl9bjfujh6g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzyqb2szu1vl9bjfujh6g.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's understand the major components.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Platters:&lt;/strong&gt; Circular disks that hold recorded data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Magnetic Coating:&lt;/strong&gt; The recording layer where magnetic patterns are stored.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spindle Motor:&lt;/strong&gt; Rotates the platters at high speed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Read/Write Head:&lt;/strong&gt; Records magnetic patterns and detects them during reading.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Actuator Arm:&lt;/strong&gt; Moves the heads to the required track.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Voice-Coil Actuator:&lt;/strong&gt; Moves the actuator arm under electronic control.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Controller Board:&lt;/strong&gt; Manages commands, positioning, data processing, and communication.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cache, if present:&lt;/strong&gt; Temporarily holds data to help manage storage operations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The platter surface is organized into tracks and sectors.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;track&lt;/strong&gt; is a circular recording path on the platter. A &lt;strong&gt;sector&lt;/strong&gt; is a smaller addressable storage unit within a track.&lt;/p&gt;

&lt;p&gt;The controller identifies the required location, positions the read/write head, and coordinates the platter's rotation.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. The Physics of an HDD: How Magnetism Stores Data
&lt;/h2&gt;

&lt;p&gt;To understand HDD storage, we first need to understand magnetism.&lt;/p&gt;

&lt;p&gt;Certain materials can retain a magnetic state even after the external magnetic field that changed them is removed.&lt;/p&gt;

&lt;p&gt;An HDD uses a magnetic recording layer containing extremely small regions. The drive records carefully controlled magnetic patterns in these regions.&lt;/p&gt;

&lt;p&gt;At the logical level, computers represent information using bits: zeroes and ones.&lt;/p&gt;

&lt;p&gt;The HDD's recording system encodes those bits into magnetic patterns that can later be detected and decoded.&lt;/p&gt;

&lt;p&gt;An important detail: a real HDD does not simply use one universal rule such as "one magnetic direction means 1, and the opposite direction means 0."&lt;/p&gt;

&lt;p&gt;It uses a recording code and carefully controlled magnetic transitions to represent information reliably.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Does the Magnetic State Remain Stored?
&lt;/h3&gt;

&lt;p&gt;When the write head creates a magnetic field, it changes the magnetic state of a tiny region on the platter.&lt;/p&gt;

&lt;p&gt;Once the region has been written, its magnetic state can remain stable after the writing field is removed.&lt;/p&gt;

&lt;p&gt;The drive does not need to continuously power the platter to preserve the recorded magnetic pattern.&lt;/p&gt;

&lt;p&gt;This is why HDD storage is called &lt;strong&gt;non-volatile storage&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;As engineers increase recording density, maintaining stable and distinguishable magnetic patterns becomes more challenging.&lt;/p&gt;

&lt;p&gt;Some advanced HDDs use &lt;strong&gt;Heat-Assisted Magnetic Recording (HAMR)&lt;/strong&gt;. This technique briefly heats a tiny region during writing, making it easier to change its magnetic state and enabling higher recording densities.&lt;/p&gt;

&lt;h3&gt;
  
  
  How an HDD Writes Data
&lt;/h3&gt;

&lt;p&gt;Now let's follow the physical process when a file is saved to an HDD.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ferqfu7tg8y0oyigt324u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ferqfu7tg8y0oyigt324u.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Receive the Request:&lt;/strong&gt; The controller receives the target logical address and data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Move the Head:&lt;/strong&gt; The actuator positions the read/write head over the appropriate track.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wait for the Correct Location:&lt;/strong&gt; The platter rotates until the target sector reaches the head.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Create a Magnetic Field:&lt;/strong&gt; Electrical current in the write element produces a controlled magnetic field.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Change the Recording Material:&lt;/strong&gt; The field changes the magnetic pattern in the target region.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Complete the Operation:&lt;/strong&gt; The drive handles the required checks and reports completion.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The physics connection is straightforward.&lt;/p&gt;

&lt;p&gt;An electric current produces a magnetic field. That field changes the magnetic state of the recording material.&lt;/p&gt;

&lt;p&gt;The drive converts electrical control into a persistent magnetic pattern.&lt;/p&gt;

&lt;h3&gt;
  
  
  How an HDD Reads Data
&lt;/h3&gt;

&lt;p&gt;Reading data follows the reverse data path.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F41gy7o7083ony7hbe7pb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F41gy7o7083ony7hbe7pb.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The computer requests data.&lt;/li&gt;
&lt;li&gt;The controller identifies the internal location.&lt;/li&gt;
&lt;li&gt;The actuator moves the head to the required track.&lt;/li&gt;
&lt;li&gt;The platter rotates the target sector beneath the head.&lt;/li&gt;
&lt;li&gt;The read element detects the magnetic signal.&lt;/li&gt;
&lt;li&gt;The drive's electronics decode the signal and correct certain errors.&lt;/li&gt;
&lt;li&gt;The controller returns the data to the computer.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Modern HDDs use highly sensitive read sensors.&lt;/p&gt;

&lt;p&gt;Changes in the magnetic field affect the sensor's electrical behavior, allowing the drive to detect very small recorded signals.&lt;/p&gt;

&lt;p&gt;The electronics then convert the detected signal into digital information.&lt;/p&gt;

&lt;p&gt;Notice the important difference: &lt;strong&gt;the read head senses the existing magnetic pattern. It does not need to rewrite the stored data.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now that we understand magnetic storage, let's explore the technology that uses electrical charge instead.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Inside an SSD: The Components
&lt;/h2&gt;

&lt;p&gt;Unlike an HDD, an SSD has no spinning platters or moving read/write heads.&lt;/p&gt;

&lt;p&gt;Instead, it uses &lt;strong&gt;NAND flash memory&lt;/strong&gt; and an electronic controller to store and retrieve data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjcw9kozlymlq7czi7eve.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjcw9kozlymlq7czi7eve.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's look at the major components.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;NAND Flash Chips:&lt;/strong&gt; Store data even when power is turned off. Each chip contains a large number of memory cells.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory Cells:&lt;/strong&gt; Store electrical states representing encoded information.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SSD Controller:&lt;/strong&gt; Coordinates read and write operations, error correction, and internal maintenance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flash Translation Layer (FTL):&lt;/strong&gt; Maps logical addresses received from the operating system to physical locations inside NAND flash memory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Error-Correction System:&lt;/strong&gt; Detects and corrects certain data errors to help maintain data integrity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DRAM, if present:&lt;/strong&gt; Temporarily stores mapping information and data to help manage storage operations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Firmware:&lt;/strong&gt; Controls the SSD's internal operations, including address mapping and memory management.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Host Interface:&lt;/strong&gt; Connects the SSD to the computer through an interface such as SATA or PCIe/NVMe.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Among these components, the controller plays a particularly important role.&lt;/p&gt;

&lt;p&gt;NAND flash memory has specific rules for writing, erasing, and reusing data. The controller manages these operations and ensures that the SSD can work efficiently.&lt;/p&gt;

&lt;p&gt;To understand how an SSD physically stores information, we need to look inside a NAND flash memory cell.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. The Physics of an SSD: How Electrical Charge Stores Data
&lt;/h2&gt;

&lt;p&gt;An SSD stores information using NAND flash memory, a type of non-volatile semiconductor memory.&lt;/p&gt;

&lt;p&gt;At the heart of NAND flash is a special semiconductor transistor.&lt;/p&gt;

&lt;p&gt;A transistor is an electronic component that controls the flow of electrical current.&lt;/p&gt;

&lt;p&gt;Many NAND flash designs use either a &lt;strong&gt;floating-gate&lt;/strong&gt; or a &lt;strong&gt;charge-trap&lt;/strong&gt; structure to store electrical charge.&lt;/p&gt;

&lt;p&gt;The stored charge changes how the transistor responds to an applied control voltage.&lt;/p&gt;

&lt;p&gt;More specifically, it changes the voltage required to make the transistor conduct.&lt;/p&gt;

&lt;p&gt;This is known as the &lt;strong&gt;threshold voltage&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The SSD controller can measure the electrical response of a memory cell and determine which encoded state it represents.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Can Charge Remain After Power Is Removed?
&lt;/h3&gt;

&lt;p&gt;The charge-storage structure is separated from other parts of the cell by insulating material.&lt;/p&gt;

&lt;p&gt;This insulation helps keep the stored electrical charge inside the memory cell, even when the computer is turned off.&lt;/p&gt;

&lt;p&gt;When power is restored, the sensing circuitry can measure the cell's electrical behavior and determine the stored state.&lt;/p&gt;

&lt;p&gt;Unlike ordinary RAM, NAND flash does not need continuous power to preserve its information.&lt;/p&gt;

&lt;p&gt;This is why NAND flash is called &lt;strong&gt;non-volatile memory&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Can One Memory Cell Store Several Bits?
&lt;/h3&gt;

&lt;p&gt;A NAND flash cell can represent more than two electrical states.&lt;/p&gt;

&lt;p&gt;By using multiple distinguishable threshold-voltage levels, a single cell can store multiple bits of information.&lt;/p&gt;

&lt;p&gt;Different NAND technologies use different numbers of bits per cell.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SLC (Single-Level Cell)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stores 1 bit per cell.&lt;/li&gt;
&lt;li&gt;Represents 2 possible states.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;MLC (Multi-Level Cell)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stores 2 bits per cell.&lt;/li&gt;
&lt;li&gt;Represents 4 possible states.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;TLC (Triple-Level Cell)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stores 3 bits per cell.&lt;/li&gt;
&lt;li&gt;Represents 8 possible states.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;QLC (Quad-Level Cell)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stores 4 bits per cell.&lt;/li&gt;
&lt;li&gt;Represents 16 possible states.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Storing more bits in each cell increases the amount of data that can fit into the same physical area.&lt;/p&gt;

&lt;p&gt;However, as the number of states increases, the voltage levels become harder to distinguish reliably.&lt;/p&gt;

&lt;p&gt;This creates trade-offs involving performance, endurance, and cost.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. How an SSD Writes Data
&lt;/h2&gt;

&lt;p&gt;Now that we understand how a flash memory cell stores information, let's follow the process of writing data to an SSD.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4rin98zvr7prrorkworu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4rin98zvr7prrorkworu.png" alt=" " width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Receive the Request:&lt;/strong&gt; The SSD receives the logical address and data from the computer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Find Suitable Space:&lt;/strong&gt; The controller selects available physical space in NAND flash memory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Apply Programming Voltages:&lt;/strong&gt; The memory circuitry applies controlled electrical voltages to change the charge stored in the cells.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set the Required States:&lt;/strong&gt; The cells are programmed to represent the encoded data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check and Protect the Data:&lt;/strong&gt; The controller verifies the programmed states and uses error-correction mechanisms to help protect the data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Update the Address Mapping:&lt;/strong&gt; The Flash Translation Layer (FTL) records the new physical location associated with the logical address.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Complete the Operation:&lt;/strong&gt; The controller reports completion according to the SSD's caching and persistence behavior.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;At the physical level, programming NAND flash can involve effects such as &lt;strong&gt;quantum tunneling&lt;/strong&gt; or &lt;strong&gt;hot-electron injection&lt;/strong&gt;, depending on the memory design.&lt;/p&gt;

&lt;p&gt;Quantum tunneling allows particles to pass through a very thin energy barrier under suitable conditions.&lt;/p&gt;

&lt;p&gt;Flash memory uses carefully engineered electric fields and insulating layers to control the movement of electrical charge.&lt;/p&gt;

&lt;p&gt;The result is a change in the electrical state of the memory cell.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Why Does an SSD Need Pages and Blocks?
&lt;/h2&gt;

&lt;p&gt;NAND flash memory is organized into two important structures: &lt;strong&gt;pages&lt;/strong&gt; and &lt;strong&gt;erase blocks&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Page:&lt;/strong&gt; A unit used for reading and programming data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Erase Block:&lt;/strong&gt; A group of multiple pages that must be erased together.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This organization creates an important limitation.&lt;/p&gt;

&lt;p&gt;A programmed page generally cannot be freely overwritten in place.&lt;/p&gt;

&lt;p&gt;When existing data needs to be changed, the SSD often writes the updated data to another available page and changes the address mapping.&lt;/p&gt;

&lt;p&gt;The old page is then marked as invalid when it is no longer needed.&lt;/p&gt;

&lt;p&gt;But what happens to all those invalid pages?&lt;/p&gt;

&lt;h3&gt;
  
  
  Garbage Collection
&lt;/h3&gt;

&lt;p&gt;The SSD controller uses a process called &lt;strong&gt;garbage collection&lt;/strong&gt; to reclaim storage space.&lt;/p&gt;

&lt;p&gt;If an erase block contains both valid and invalid pages, the controller must first preserve the valid data.&lt;/p&gt;

&lt;p&gt;It can then erase the entire block and make the space available for new writes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wear Leveling
&lt;/h3&gt;

&lt;p&gt;The controller also uses &lt;strong&gt;wear leveling&lt;/strong&gt; to distribute write and erase operations across the flash memory.&lt;/p&gt;

&lt;p&gt;This helps prevent certain memory areas from wearing out much faster than others.&lt;/p&gt;

&lt;h3&gt;
  
  
  TRIM
&lt;/h3&gt;

&lt;p&gt;Another important feature is &lt;strong&gt;TRIM&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When the operating system deletes a file or releases storage space, it can send TRIM information to a compatible SSD.&lt;/p&gt;

&lt;p&gt;This informs the controller that certain logical blocks no longer contain data that needs to be preserved.&lt;/p&gt;

&lt;p&gt;The controller can use this information to manage available storage space more efficiently.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. How an SSD Reads Data
&lt;/h2&gt;

&lt;p&gt;Reading data from an SSD is different from writing it.&lt;/p&gt;

&lt;p&gt;Instead of changing the electrical state of the memory cells, the SSD senses their existing states.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1ocrdie3xel8pw3l5rha.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1ocrdie3xel8pw3l5rha.png" alt=" " width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The process works as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The computer requests a logical block of data.&lt;/li&gt;
&lt;li&gt;The controller consults the Flash Translation Layer (FTL) to locate the corresponding physical flash location.&lt;/li&gt;
&lt;li&gt;The memory circuitry selects the required NAND location.&lt;/li&gt;
&lt;li&gt;The sensing circuitry measures the electrical responses of the memory cells.&lt;/li&gt;
&lt;li&gt;The controller interprets the stored states and applies error-correction mechanisms.&lt;/li&gt;
&lt;li&gt;The requested data is returned to the computer.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The important point is that &lt;strong&gt;reading does not require rewriting the stored data&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The SSD senses the existing electrical states, decodes them, and converts them back into digital information.&lt;/p&gt;

&lt;p&gt;No storage head needs to move, and no platter needs to rotate.&lt;/p&gt;

&lt;p&gt;The SSD still has processing and memory-access delays, but it avoids the mechanical waiting associated with an HDD.&lt;/p&gt;




&lt;h2&gt;
  
  
  9. Why SSDs Often Feel Much Faster
&lt;/h2&gt;

&lt;p&gt;Imagine opening an application on your computer.&lt;/p&gt;

&lt;p&gt;The application may need to load hundreds of small files from different storage locations.&lt;/p&gt;

&lt;p&gt;These files could include application resources, configuration files, libraries, and other required data.&lt;/p&gt;

&lt;p&gt;An HDD may repeatedly move its read head and wait for the platter to rotate to the correct position before accessing each location.&lt;/p&gt;

&lt;p&gt;An SSD works differently.&lt;/p&gt;

&lt;p&gt;It accesses NAND flash locations electronically, without mechanical head movement or rotational waiting.&lt;/p&gt;

&lt;p&gt;Depending on the drive's design and workload, it can also use multiple NAND channels and memory dies to perform operations in parallel.&lt;/p&gt;

&lt;p&gt;This is why SSDs generally perform much better for random reads and often make computers feel more responsive.&lt;/p&gt;

&lt;h3&gt;
  
  
  Three Important Storage Performance Terms
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Latency&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Latency is the time taken to complete an individual storage operation.&lt;/p&gt;

&lt;p&gt;Lower latency means the computer spends less time waiting for a response from the storage device.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Throughput&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Throughput describes how much data a storage device can transfer within a given period.&lt;/p&gt;

&lt;p&gt;It is commonly measured in MB/s or GB/s.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. IOPS (Input/Output Operations Per Second)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;IOPS measures how many individual read or write operations a storage device can complete per second.&lt;/p&gt;

&lt;p&gt;It is particularly useful when evaluating workloads involving many small storage requests.&lt;/p&gt;

&lt;h3&gt;
  
  
  Sequential Access vs. Random Access
&lt;/h3&gt;

&lt;p&gt;There is an important difference between reading one large file and reading thousands of small files scattered across a storage device.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sequential Access:&lt;/strong&gt; Data is read or written in a continuous sequence. HDDs can perform reasonably well in this type of workload because the head can remain near the required recording area.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Random Access:&lt;/strong&gt; Data is requested from different storage locations. HDDs must repeatedly reposition their heads and wait for the required sectors to rotate underneath them.&lt;/p&gt;

&lt;p&gt;SSDs avoid these mechanical delays because they access flash memory electronically.&lt;/p&gt;

&lt;p&gt;This is one of the main reasons SSDs offer a significant advantage in everyday computing tasks.&lt;/p&gt;

&lt;h3&gt;
  
  
  Are All SSDs Equally Fast?
&lt;/h3&gt;

&lt;p&gt;No. Different SSDs can have very different performance characteristics.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SATA SSDs:&lt;/strong&gt; Use the SATA interface, which has lower bandwidth than modern PCIe interfaces.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NVMe SSDs:&lt;/strong&gt; Use the NVMe protocol over PCIe, allowing much higher data-transfer performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, the interface is not the only factor that determines speed.&lt;/p&gt;

&lt;p&gt;The SSD controller, NAND flash type, number of memory channels, capacity, firmware, and workload can all influence actual performance.&lt;/p&gt;

&lt;p&gt;An SSD's advertised maximum speed does not necessarily represent its performance in every real-world situation.&lt;/p&gt;

&lt;p&gt;The type of workload matters just as much as the storage technology itself.&lt;/p&gt;




&lt;h2&gt;
  
  
  10. HDD vs SSD: The Key Differences
&lt;/h2&gt;

&lt;p&gt;HDDs and SSDs serve the same purpose: storing data even when the computer is turned off.&lt;/p&gt;

&lt;p&gt;However, they use different physical mechanisms to store and retrieve information.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Physical Storage
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;HDD:&lt;/strong&gt; Stores data as magnetic patterns on rotating platters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SSD:&lt;/strong&gt; Stores data as electrical states in NAND flash memory.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Moving Parts
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;HDD:&lt;/strong&gt; Contains spinning platters and moving read/write heads.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SSD:&lt;/strong&gt; Has no moving storage parts.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Writing Data
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;HDD:&lt;/strong&gt; Uses a magnetic field to change patterns on the recording surface.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SSD:&lt;/strong&gt; Uses controlled electrical conditions to program flash memory cells.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Reading Data
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;HDD:&lt;/strong&gt; Detects magnetic signals from the platter and converts them into digital data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SSD:&lt;/strong&gt; Senses the electrical behavior of flash cells to recover the stored data.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Access Speed
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;HDD:&lt;/strong&gt; Must move its head and wait for the platter to rotate to the required location.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SSD:&lt;/strong&gt; Accesses flash memory electronically, avoiding mechanical seeking and rotational delays.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Noise
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;HDD:&lt;/strong&gt; May produce audible noise from its motor and moving components.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SSD:&lt;/strong&gt; Operates silently during normal storage activity.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Shock Resistance
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;HDD:&lt;/strong&gt; More vulnerable to physical shock, especially while operating.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SSD:&lt;/strong&gt; Generally more resistant to physical shock because it has no moving storage parts.&lt;/p&gt;

&lt;h3&gt;
  
  
  8. Cost per Gigabyte
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;HDD:&lt;/strong&gt; Usually costs less per gigabyte, making it suitable for large storage requirements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SSD:&lt;/strong&gt; Usually costs more per gigabyte, although prices vary by capacity and model.&lt;/p&gt;

&lt;h3&gt;
  
  
  9. Endurance and Failure
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;HDD:&lt;/strong&gt; Can fail because of mechanical wear, head or motor problems, and electronic faults.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SSD:&lt;/strong&gt; Flash cells have finite write endurance, and the controller or other electronic components can also fail.&lt;/p&gt;

&lt;p&gt;Neither technology is guaranteed to last forever.&lt;/p&gt;

&lt;p&gt;Actual reliability depends on the device, workload, operating conditions, and usage.&lt;/p&gt;




&lt;h2&gt;
  
  
  11. Which Storage Technology Should You Choose?
&lt;/h2&gt;

&lt;p&gt;The choice between an HDD and an SSD depends on what you need from your computer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Choose an SSD When:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;You want faster operating system startup.&lt;/li&gt;
&lt;li&gt;You frequently open applications and development tools.&lt;/li&gt;
&lt;li&gt;You work with many small files.&lt;/li&gt;
&lt;li&gt;You need better random-access performance.&lt;/li&gt;
&lt;li&gt;You prefer silent operation and better resistance to physical shock.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Choose an HDD When:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;You need large storage capacity at a lower cost per gigabyte.&lt;/li&gt;
&lt;li&gt;You store large media collections.&lt;/li&gt;
&lt;li&gt;You maintain archives and backups.&lt;/li&gt;
&lt;li&gt;Maximum access speed is less important than storage capacity and cost.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why Not Use Both?
&lt;/h3&gt;

&lt;p&gt;You do not always need to choose one technology over the other.&lt;/p&gt;

&lt;p&gt;A practical setup can use both:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SSD:&lt;/strong&gt; Operating system, applications, development tools, and active projects.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HDD:&lt;/strong&gt; Large media collections, archives, and additional storage.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This combines the responsiveness of an SSD with the economical capacity of an HDD.&lt;/p&gt;

&lt;p&gt;Regardless of which storage technology you choose, always maintain separate backups of important data.&lt;/p&gt;

&lt;p&gt;No storage device is a substitute for a backup.&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion: Same Data, Different Physics
&lt;/h2&gt;

&lt;p&gt;When you click Save, your computer turns an application-level request into storage commands.&lt;/p&gt;

&lt;p&gt;The operating system organizes the file, and the storage device converts those commands into physical operations.&lt;/p&gt;

&lt;p&gt;An HDD uses electrical current to create magnetic fields that change a recording surface. A read sensor detects the resulting magnetic patterns and converts them back into digital data.&lt;/p&gt;

&lt;p&gt;An SSD uses controlled electrical conditions to change the charge stored in semiconductor cells.&lt;/p&gt;

&lt;p&gt;Its controller maps logical addresses to physical locations, reads the cells' electrical states, corrects errors, and manages the special rules of NAND flash memory.&lt;/p&gt;

&lt;p&gt;Both devices preserve information without continuous power, but they achieve this through different physical mechanisms.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;An HDD stores data magnetically. An SSD stores data through electrical states in flash memory.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Understanding that distinction explains their internal components, their performance differences, and why both technologies continue to serve different storage needs.&lt;/p&gt;




&lt;h2&gt;
  
  
  Further Reading
&lt;/h2&gt;

&lt;p&gt;For readers who want to explore storage technology in more detail:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.seagate.com/" rel="noopener noreferrer"&gt;Seagate — Hard Drives and Storage Technology&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.micron.com/" rel="noopener noreferrer"&gt;Micron — NAND Flash and Memory Technology&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://nvmexpress.org/specifications/" rel="noopener noreferrer"&gt;NVM Express — Specifications&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.kernel.org/" rel="noopener noreferrer"&gt;Linux Kernel Documentation — Storage and Block Layer&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Technical note: The diagrams in this article are simplified explanatory models. Actual HDD recording codes, read-head designs, NAND cell structures, controller algorithms, caching behavior, and durability characteristics vary by device and generation.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>hardware</category>
      <category>science</category>
    </item>
    <item>
      <title>From Hello, World! to Millions of Pixels: How Your Computer Screen Really Works</title>
      <dc:creator>Al Ameen S</dc:creator>
      <pubDate>Sun, 11 Oct 2026 18:16:29 +0000</pubDate>
      <link>https://dev.to/alameens/from-hello-world-to-millions-of-pixels-how-your-computer-screen-really-works-1233</link>
      <guid>https://dev.to/alameens/from-hello-world-to-millions-of-pixels-how-your-computer-screen-really-works-1233</guid>
      <description>&lt;p&gt;&lt;em&gt;&lt;em&gt;From colored text to photographs and videos, discover how software, graphics hardware, and tiny pixels turn digital information into visible light.&lt;/em&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4zun7onxqi4qcm0ae84w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4zun7onxqi4qcm0ae84w.png" alt=" " width="800" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You type a few words, choose a color, and press Enter. A moment later, those words appear on your screen. But how does a computer turn instructions and numbers into something your eyes can actually see?&lt;/p&gt;

&lt;p&gt;Imagine writing a program that displays &lt;code&gt;Hello, World!&lt;/code&gt; in red, green, and blue. It looks simple. Yet behind those colored letters, several layers of software and hardware work together.&lt;/p&gt;

&lt;p&gt;Your program doesn't directly paint letters onto the physical screen. It describes what should appear. Your computer turns that description into visual data, prepares it for display, and eventually produces light that reaches your eyes.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Let's make Hello, World! colorful
&lt;/h2&gt;

&lt;p&gt;Create a file named &lt;code&gt;hello.html&lt;/code&gt; and open it in a browser.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;canvas&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"screen"&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"420"&lt;/span&gt; &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"100"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/canvas&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;screen&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2d&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;font&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bold 32px Arial&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fillStyle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;red&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fillText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fillStyle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;green&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fillText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;World&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;120&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fillStyle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;blue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fillText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;230&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The program chooses a font, sets a drawing color, and asks the browser to draw text at specific positions. It never tells the physical monitor how to make the letters.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. How can three numbers represent a color?
&lt;/h2&gt;

&lt;p&gt;A common way to represent color is RGB: Red, Green, and Blue. In an 8-bit-per-channel RGB representation, each channel ranges from 0 to 255.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F924w6b783sh1h26qq2z3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F924w6b783sh1h26qq2z3.png" alt=" " width="800" height="267"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each channel has 256 possible values. Three channels therefore allow 256 × 256 × 256 = &lt;strong&gt;16,777,216&lt;/strong&gt; possible RGB combinations. That is about &lt;strong&gt;16.7 million&lt;/strong&gt; combinations, though a particular monitor cannot necessarily reproduce every one and human vision cannot distinguish every possible pair.&lt;/p&gt;

&lt;p&gt;This is additive color mixing. Combining maximum red and green produces yellow; combining red, green, and blue at their maximum values produces white. Mixing physical paints follows different rules.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Your computer doesn't see letters the way you do
&lt;/h2&gt;

&lt;p&gt;The text &lt;code&gt;Hello&lt;/code&gt; is character data. A font provides designs for letters and symbols. A glyph is a visual representation selected for a character or group of characters, and a rendering system draws that shape.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Focdzl9jo6uqj8abhvl1k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Focdzl9jo6uqj8abhvl1k.png" alt=" " width="799" height="282"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Turning shapes into a grid of pixels is called &lt;strong&gt;rasterization&lt;/strong&gt;. Antialiasing adjusts edge pixels to make curves and diagonals look smoother. The character can stay the same while its glyph changes with the font.&lt;/p&gt;

&lt;p&gt;For platform-specific details, see &lt;a href="https://learn.microsoft.com/en-us/windows/win32/direct2d/direct2d-and-directwrite" rel="noopener noreferrer"&gt;Microsoft's Direct2D and DirectWrite documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. What exactly is a pixel?
&lt;/h2&gt;

&lt;p&gt;A pixel, short for picture element, is a unit of a digital image. An image is commonly represented as a rectangular grid of pixels, each carrying color information for its position.&lt;/p&gt;

&lt;p&gt;A 1920 × 1080 image contains &lt;strong&gt;2,073,600 pixels&lt;/strong&gt;. In a simple 8-bit RGBA representation, each pixel uses four bytes: red, green, blue, and alpha. A fully opaque red pixel could be &lt;code&gt;(255, 0, 0, 255)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If every pixel in a 1920 × 1080 image used this simple four-byte format, the buffer would occupy about 7.91 MiB. Real systems use different formats and memory layouts, and applications may hold several buffers.&lt;/p&gt;

&lt;p&gt;Explore pixel data with &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Pixel_manipulation_with_canvas" rel="noopener noreferrer"&gt;MDN's tutorial&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Where does the operating system fit in?
&lt;/h2&gt;

&lt;p&gt;Your browser, terminal, and other applications each create visual content. On many desktop systems, a window compositor combines application surfaces into the desktop image, respecting their positions, clipping, transparency, and stacking order.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1ckrzubr3ojk0j61ebtn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1ckrzubr3ojk0j61ebtn.png" alt=" " width="800" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The operating system coordinates processes, memory, hardware access, and display resources. It does not necessarily draw every letter or calculate every pixel itself. Applications, graphics libraries, drivers, and hardware share the work. Implementations differ between Windows, Linux, and macOS.&lt;/p&gt;

&lt;p&gt;References: &lt;a href="https://learn.microsoft.com/en-us/windows/win32/learnwin32/overview-of-the-windows-graphics-architecture" rel="noopener noreferrer"&gt;Windows graphics architecture&lt;/a&gt; and &lt;a href="https://docs.kernel.org/6.15/gpu/drm-kms.html" rel="noopener noreferrer"&gt;Linux Kernel Mode Setting&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Why do computers have GPUs?
&lt;/h2&gt;

&lt;p&gt;The CPU handles general-purpose computing. A GPU, or Graphics Processing Unit, is specialized for graphics workloads and can perform many similar operations in parallel.&lt;/p&gt;

&lt;p&gt;A GPU may draw shapes, process textures, apply effects, or render 3D scenes. But it does not necessarily handle every pixel on every computer. Some work happens on the CPU, integrated graphics may share system memory, and video decoding may use specialized hardware.&lt;/p&gt;

&lt;p&gt;For our example, the browser and graphics stack coordinate the drawing. The exact division of work depends on the operating system, browser, and hardware.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. How do digital numbers become actual light?
&lt;/h2&gt;

&lt;p&gt;A display controller manages the presentation of image data and its timing. The data reaches the display through an internal connection or an interface such as HDMI or DisplayPort. The panel's electronics then control the visible output.&lt;/p&gt;

&lt;p&gt;LCD panels use a backlight and liquid-crystal layers to regulate light passing through color filters. OLED elements emit light directly when electrically driven. These are simplified descriptions; real panel structures vary.&lt;/p&gt;

&lt;p&gt;An RGB value is not a universal instruction to emit a fixed amount of physical light. The result depends on the color space, image processing, display calibration, and panel capabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. What changes when you open a photograph?
&lt;/h2&gt;

&lt;p&gt;A JPEG file contains encoded image data rather than a simple uncompressed RGB value for every pixel. An image decoder reconstructs pixel values, and the application may scale or transform the image before drawing it into a visual surface.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0jjzm0uesbhr8lzqmmed.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0jjzm0uesbhr8lzqmmed.png" alt=" " width="800" height="240"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Text and photographs start differently: text is laid out and drawn as glyphs, while a compressed photograph must be decoded. Both can eventually become visual content that is presented on the display.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. What happens when you play a video?
&lt;/h2&gt;

&lt;p&gt;A video adds time. A player reads a stream, decodes frames, processes or scales them when needed, and presents them according to playback timing. Audio and video are synchronized where applicable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Frame rate&lt;/strong&gt; describes how many frames are produced or presented per second. &lt;strong&gt;Refresh rate&lt;/strong&gt; describes how frequently a display refreshes its image. A 24-frames-per-second video can play on a 60 Hz display; the two rates do not need to match one-to-one.&lt;/p&gt;

&lt;p&gt;Late decoding or uneven frame presentation can cause stuttering. The precise pipeline depends on the video format, application, operating system, and hardware.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Why does this matter?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Blurry text:&lt;/strong&gt; scaling and pixel-density differences can affect rendering.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Slow games:&lt;/strong&gt; complex scenes can exceed available processing or presentation budgets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Video stuttering:&lt;/strong&gt; decoding or frame scheduling may not keep up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Screen tearing:&lt;/strong&gt; presentation and display scanning can become unsynchronized.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Different colors across monitors:&lt;/strong&gt; displays and their configurations can reproduce color differently.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These symptoms can have multiple causes, so they are not diagnoses on their own. Understanding the pipeline gives you a framework for asking better troubleshooting questions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: Every visible thing has a journey
&lt;/h2&gt;

&lt;p&gt;You wrote a few instructions and selected three colors. The application supplied the content, the rendering system turned text into visual shapes, and the graphics stack prepared it for presentation. Display hardware then controlled the panel so that light reached your eyes.&lt;/p&gt;

&lt;p&gt;A photograph follows a different initial path because its encoded data must be decoded. A video adds repeated frames and timing. But all three reveal the same idea:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A computer screen is not simply showing your code. It is presenting the visual result of a process that transforms digital information into light.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  References and further reading
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial" rel="noopener noreferrer"&gt;MDN — Canvas API tutorial&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Pixel_manipulation_with_canvas" rel="noopener noreferrer"&gt;MDN — Pixel manipulation with canvas&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/windows/win32/direct2d/direct2d-and-directwrite" rel="noopener noreferrer"&gt;Microsoft — Direct2D and DirectWrite&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/windows/win32/learnwin32/overview-of-the-windows-graphics-architecture" rel="noopener noreferrer"&gt;Microsoft — Windows graphics architecture&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.kernel.org/6.15/gpu/drm-kms.html" rel="noopener noreferrer"&gt;Linux kernel — Kernel Mode Setting&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio" rel="noopener noreferrer"&gt;MDN — devicePixelRatio&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement/requestVideoFrameCallback" rel="noopener noreferrer"&gt;MDN — requestVideoFrameCallback()&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;Technical note: The HTML example uses the Canvas 2D API. The architecture descriptions are conceptual; specific rendering paths vary by platform and hardware. Run the example and verify links before publication.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>architecture</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
