Category: Uncategorized

  • CresignSys Learn — Lesson 016

    Course: From Basic Science to Web Hosting

    Module 04 — Operating Systems

    What Really Happens When You Run a Linux Command?

    Difficulty: Beginner → Intermediate
    Prerequisites: Lesson 015 — What Is an Operating System?
    Estimated time: 30 minutes

    We will use a real command you have already encountered:

    sudo systemctl restart nginx

    The goal is to understand what happens from your keyboard to the CPU, through Linux, to Nginx.


    1. Start at the Beginning

    You see:

    $ sudo systemctl restart nginx

    It looks like one command.

    But underneath, many layers are involved:

    Keyboard
       ↓
    Terminal
       ↓
    Shell
       ↓
    Command
       ↓
    Program
       ↓
    System calls
       ↓
    Linux kernel
       ↓
    systemd
       ↓
    Nginx

    And underneath all of that:

    CPU
    RAM
    Storage
    Electronic circuits
    Transistors

    2. What Is a Terminal?

    A terminal provides an interface through which you can interact with the operating system using text.

    For example:

    ubuntu@server:~$

    You type:

    ls

    The terminal receives your keyboard input.

    Conceptually:

    Keyboard
       ↓
    Terminal
       ↓
    Text input

    3. What Is a Shell?

    The terminal itself isn’t normally responsible for interpreting shell commands.

    A shell is a program that interprets commands.

    Common shells include:

    bash
    zsh
    sh
    fish

    Ubuntu commonly uses Bash by default in many environments.

    So:

    Keyboard
       ↓
    Terminal
       ↓
    Bash

    4. Shell Prompt

    When you see something like:

    ubuntu@server:~$

    the shell is effectively saying:

    I am ready to receive a command.

    You type:

    ls

    The shell reads it.


    5. The Shell Parses the Command

    Suppose you type:

    sudo systemctl restart nginx

    The shell separates the command into components roughly like:

    sudo
    systemctl
    restart
    nginx

    These have different roles.


    6. First Word: sudo

    sudo is a program that allows an authorized user to run a command with elevated privileges.

    So:

    sudo systemctl restart nginx

    is conceptually:

    Run systemctl
           ↓
    with elevated privileges

    The exact authorization process depends on the system’s sudo configuration.


    7. Second Word: systemctl

    systemctl is a command-line program used to communicate with systemd.

    So:

    systemctl

    is not the service manager itself.

    It is a client/control program.

    Conceptually:

    You
     ↓
    systemctl
     ↓
    systemd

    8. Third Word: restart

    This is an argument telling systemctl what operation you want.

    restart

    means:

    Stop/restart the specified service

    9. Fourth Word: nginx

    This identifies the service unit.

    nginx

    So the whole request is approximately:

    sudo
     ↓
    run systemctl with elevated privileges
    
    systemctl
     ↓
    talk to systemd
    
    restart
     ↓
    requested operation
    
    nginx
     ↓
    target service

    10. What Happens Next?

    The sudo program performs its authorization work and then executes the requested command with the appropriate credentials.

    Then:

    systemctl
       ↓
    communicates with
       ↓
    systemd

    On a system using systemd, this communication is typically performed through system mechanisms such as Unix-domain sockets and the D-Bus/systemd management interfaces.

    You don’t need to manually implement any of this.

    The OS handles it.


    11. What Is systemd?

    systemd is a system and service manager.

    It manages units such as:

    Services
    Sockets
    Mounts
    Timers
    Targets

    For our example:

    nginx.service

    is a service unit.


    12. systemd Checks the Service

    When you request:

    systemctl restart nginx

    systemd determines how the Nginx service should be managed based on its unit configuration.

    Conceptually:

    systemctl
       ↓
    systemd
       ↓
    nginx.service

    13. Where Does the Service Configuration Come From?

    Systemd unit files can exist in locations such as:

    /etc/systemd/system/

    and distribution/package-managed locations such as:

    /usr/lib/systemd/system/

    The exact locations and precedence depend on the system.

    A service unit can describe things such as:

    Service name
    Dependencies
    Command to start
    Command to stop
    Restart behavior
    User
    Environment

    14. systemd Starts Nginx

    Eventually systemd launches the Nginx process according to the service configuration.

    Conceptually:

    systemd
       ↓
    fork/exec and process management
       ↓
    Nginx

    The kernel is involved in creating and managing the process.


    15. What Is exec?

    Unix-like systems have system calls that allow a process to replace its current program image with another executable.

    A family of functions commonly called exec* is used for this purpose.

    Conceptually:

    Existing process
          ↓
    exec()
          ↓
    New program image

    This is one of the fundamental mechanisms behind launching programs.


    16. What Is a System Call?

    Applications cannot directly perform arbitrary privileged hardware operations.

    Instead, they request services from the kernel through:

    System calls

    Conceptually:

    Application
        ↓
    System call
        ↓
    Linux kernel
        ↓
    Hardware / kernel-managed resources

    Examples include operations related to:

    Files
    Processes
    Memory
    Networking
    Time
    Devices

    17. User Space and Kernel Space

    Linux separates normal application execution from privileged kernel execution.

    Conceptually:

    ┌───────────────────────────┐
    │        USER SPACE         │
    │                           │
    │ Bash                      │
    │ sudo                      │
    │ systemctl                 │
    │ Nginx                     │
    │ PHP                       │
    │ MySQL                     │
    └─────────────┬─────────────┘
                  │
            System calls
                  │
    ┌─────────────▼─────────────┐
    │       KERNEL SPACE        │
    │                           │
    │ Process management        │
    │ Memory management         │
    │ Networking                │
    │ Filesystems               │
    │ Device drivers            │
    └─────────────┬─────────────┘
                  │
    ┌─────────────▼─────────────┐
    │         HARDWARE          │
    │ CPU / RAM / SSD / NIC     │
    └───────────────────────────┘

    This separation is fundamental to operating-system design.


    18. Why Can’t Nginx Just Control the Hardware?

    Security and stability.

    Imagine every application could directly control:

    RAM
    SSD
    Network hardware
    CPU control mechanisms

    One buggy program could potentially destroy the system.

    Instead:

    Application
        ↓
    Kernel
        ↓
    Controlled access
        ↓
    Hardware

    The kernel acts as a privileged resource manager.


    19. What Happens Inside the CPU?

    At the hardware level, the CPU executes machine instructions.

    Conceptually:

    Machine instruction
          ↓
    CPU fetch
          ↓
    Decode
          ↓
    Execute
          ↓
    Memory/register operations

    And physically:

    CPU instructions
          ↓
    Transistor switching
          ↓
    Electrical signals

    So even:

    systemctl restart nginx

    eventually becomes processor activity.


    20. What Happens in RAM?

    Programs need memory.

    For example:

    Bash
    sudo
    systemctl
    systemd
    Nginx

    all require memory while executing.

    Conceptually:

    SSD
     ↓
    Program executable
     ↓
    Linux loads program
     ↓
    RAM
     ↓
    CPU executes instructions

    21. What Happens on the SSD?

    Programs and configuration files are stored persistently.

    For example:

    /usr/bin/systemctl
    /usr/bin/sudo
    /usr/sbin/nginx
    /etc/nginx/
    /etc/systemd/

    When required, executable code and data are loaded from storage into memory.

    Simplified:

    SSD
     ↓
    Filesystem
     ↓
    Executable/data
     ↓
    RAM
     ↓
    CPU

    22. What Happens to Nginx?

    After systemd successfully starts or restarts Nginx:

    Nginx process
          ↓
    Loads configuration
          ↓
    Opens required resources
          ↓
    Creates/listens on sockets
          ↓
    Waits for network requests

    For HTTPS, it may listen on:

    TCP 443

    For HTTP:

    TCP 80

    23. Your Website Request

    Now suppose someone opens:

    https://templates.cresignsys.com

    The path becomes:

    Browser
     ↓
    DNS
     ↓
    IP address
     ↓
    Internet
     ↓
    Server
     ↓
    TCP connection
     ↓
    TLS connection
     ↓
    Nginx

    Nginx then processes the HTTP request.


    24. Where Does TLS Fit?

    Your SSL/TLS certificate belongs here:

    Internet
       ↓
    TCP
       ↓
    TLS
       ↓
    HTTP
       ↓
    Nginx

    More precisely, modern HTTPS normally uses:

    HTTP
    over
    TLS
    over
    TCP
    over
    IP

    Although HTTP/3 uses QUIC rather than TCP, which changes the transport layer.

    For your current Nginx setup, HTTPS is commonly TCP + TLS + HTTP/1.1 or HTTP/2.


    25. Nginx Reads the Request

    Suppose the browser requests:

    GET /

    Nginx examines:

    Hostname
    Path
    Method
    Headers
    TLS connection

    For example:

    Host: templates.cresignsys.com

    Nginx uses its configuration to determine what should happen.


    26. Nginx May Serve a Static File

    If the request is for:

    style.css

    Nginx can directly read the file.

    Conceptually:

    Browser
     ↓
    Nginx
     ↓
    Filesystem
     ↓
    style.css
     ↓
    Nginx
     ↓
    Browser

    27. Nginx May Send the Request to PHP

    If WordPress needs PHP processing:

    Browser
     ↓
    Nginx
     ↓
    PHP-FPM
     ↓
    WordPress

    PHP-FPM executes the PHP application logic.


    28. WordPress May Query MySQL

    For dynamic content:

    WordPress
     ↓
    Database query
     ↓
    MySQL
     ↓
    Database result
     ↓
    WordPress

    Then:

    WordPress
     ↓
    HTML generation
     ↓
    PHP-FPM
     ↓
    Nginx
     ↓
    TLS
     ↓
    Internet
     ↓
    Browser

    29. One Browser Request — Full Journey

    Here is the complete path:

    USER
     │
     │ enters URL
     ▼
    BROWSER
     │
     ▼
    DNS
     │
     ▼
    IP ADDRESS
     │
     ▼
    INTERNET
     │
     ▼
    SERVER NIC
     │
     ▼
    LINUX NETWORK STACK
     │
     ▼
    TCP
     │
     ▼
    TLS
     │
     ▼
    NGINX
     │
     ├──── static file ────► FILESYSTEM
     │
     └──── dynamic request ─► PHP-FPM
                                  │
                                  ▼
                              WORDPRESS
                                  │
                                  ▼
                                MYSQL
                                  │
                                  ▼
                             HTML RESPONSE
                                  │
                                  ▼
                               NGINX
                                  │
                                  ▼
                                TLS
                                  │
                                  ▼
                               BROWSER

    30. The Most Important Layering Concept

    Don’t think of the server as one program.

    Think of it as layers:

    Layer 1
    Physical hardware
    
    Layer 2
    Firmware
    
    Layer 3
    Linux kernel
    
    Layer 4
    System services
    
    Layer 5
    Network stack
    
    Layer 6
    TLS
    
    Layer 7
    Web server
    
    Layer 8
    Application runtime
    
    Layer 9
    Application
    
    Layer 10
    Database

    Each layer depends on lower layers.


    31. Why This Matters for Troubleshooting

    Suppose your website doesn’t open.

    Don’t immediately assume:

    “WordPress is broken.”

    There are many possible layers:

    DNS
     ↓
    IP
     ↓
    Firewall
     ↓
    Network
     ↓
    TCP
     ↓
    TLS
     ↓
    Nginx
     ↓
    PHP
     ↓
    WordPress
     ↓
    MySQL

    The correct troubleshooting method is:

    Find the lowest layer that is failing, then move upward.


    32. Example

    If:

    systemctl status nginx

    shows Nginx is stopped, don’t troubleshoot WordPress first.

    Check:

    Hardware
     ↓
    Linux
     ↓
    systemd
     ↓
    Nginx

    Only after Nginx works should you move upward.


    33. Your Current Learning Position

    You started from:

    Atom

    and reached:

    Linux command

    The complete path is:

    Atom
     ↓
    Electron
     ↓
    Charge
     ↓
    Electricity
     ↓
    Circuit
     ↓
    Semiconductor
     ↓
    Transistor
     ↓
    Logic
     ↓
    Binary
     ↓
    CPU
     ↓
    Computer
     ↓
    Operating System
     ↓
    Linux
     ↓
    Command

    Now we can begin going deeper into Linux itself.


    34. Next Lesson — 017

    What Is the Linux Filesystem?

    We will start from the absolute foundation:

    /
    ├── bin
    ├── boot
    ├── dev
    ├── etc
    ├── home
    ├── lib
    ├── media
    ├── mnt
    ├── opt
    ├── proc
    ├── root
    ├── run
    ├── sbin
    ├── srv
    ├── sys
    ├── tmp
    ├── usr
    ├── var
    └── storage

    We will learn what every directory actually means, why /etc contains configuration, why /var contains changing data, what /proc and /sys really are, and how your:

    /storage/websites/

    fits into the Linux architecture.

    After that we can progress systematically through:

    Linux filesystem → users → permissions → processes → services → networking → DNS → TCP/IP → TLS → Nginx → PHP-FPM → MySQL → WordPress → web hosting.

  • CresignSys Learn — Lesson 015

    Course: From Basic Science to Web Hosting

    Module 04 — Operating Systems

    What Is an Operating System?

    Difficulty: Beginner → Intermediate
    Prerequisites: Lesson 014 — What Is a Computer?
    Estimated time: 30 minutes


    1. The Big Question

    We now have:

    Transistors
     ↓
    Digital circuits
     ↓
    CPU
     ↓
    Memory
     ↓
    Storage
     ↓
    Computer

    But there is a problem.

    The hardware itself does not know what you mean when you say:

    ls

    or:

    cd /storage/websites/

    or:

    sudo systemctl restart nginx

    Something must translate software requests into controlled operations on hardware.

    That major layer is the:

    Operating System


    2. What Is an Operating System?

    An operating system, or OS, is system software that manages computer hardware and provides services and abstractions that applications use.

    Examples:

    Linux
    Windows
    macOS
    Android

    For your web server:

    Ubuntu Linux

    is the important operating-system environment.


    3. The Computer Stack

    Think of a computer as layers:

    ┌─────────────────────────────┐
    │ Applications                │
    │ WordPress, Nginx, PHP, etc. │
    ├─────────────────────────────┤
    │ Libraries / Runtime         │
    ├─────────────────────────────┤
    │ System Calls                │
    ├─────────────────────────────┤
    │ Operating System / Kernel   │
    ├─────────────────────────────┤
    │ Device Drivers              │
    ├─────────────────────────────┤
    │ Hardware                    │
    │ CPU / RAM / SSD / NIC       │
    └─────────────────────────────┘

    Each layer hides some complexity from the layer above it.


    4. Why Do We Need an Operating System?

    Imagine you want to save:

    hello.txt

    Without an operating system, software would need to understand enormous amounts of hardware detail:

    SSD controller
     ↓
    PCIe
     ↓
    storage commands
     ↓
    flash memory
     ↓
    error correction
     ↓
    physical storage locations

    Instead, your application can ask the OS to create/write a file.

    Application
        ↓
    Operating System
        ↓
    Filesystem
        ↓
    Storage driver
        ↓
    SSD

    The OS provides the abstraction.


    5. Hardware Is Physical

    Your server has physical resources such as:

    CPU
    RAM
    SSD
    Network interface

    The OS manages them.

    For example:

    CPU
     ↓
    Processes
    
    RAM
     ↓
    Memory allocation
    
    SSD
     ↓
    Files
    
    Network interface
     ↓
    Network communication

    6. The Kernel

    The most important component of a traditional operating system is the:

    Kernel

    The kernel operates with high privileges and manages critical hardware and system resources.

    Conceptually:

    Applications
         ↓
    System calls
         ↓
    Kernel
         ↓
    Hardware

    Linux is fundamentally the name of the kernel.


    7. Linux vs Ubuntu

    This distinction is important.

    Linux

    Primarily refers to the Linux kernel.

    Ubuntu

    A Linux distribution.

    It combines:

    Linux kernel
    +
    System utilities
    +
    Package management
    +
    Libraries
    +
    Applications
    +
    Configuration

    So:

    Ubuntu
       ↓
    uses
       ↓
    Linux kernel

    8. What Is a Linux Distribution?

    A distribution packages the Linux kernel with many other components.

    Examples:

    Ubuntu
    Debian
    Fedora
    Rocky Linux
    Arch Linux

    Your server uses Ubuntu.

    Therefore:

    Your server
     ↓
    Ubuntu
     ↓
    Linux kernel

    9. Booting a Computer

    What happens when a computer starts?

    Very simplified:

    Power ON
       ↓
    Firmware
       ↓
    Bootloader
       ↓
    Linux kernel
       ↓
    Initial userspace
       ↓
    System services
       ↓
    Login / applications

    Let’s examine this carefully.


    10. Firmware

    When the machine starts, firmware initializes hardware and prepares the system to boot.

    On modern PCs, this is commonly:

    UEFI

    The exact boot architecture can differ, especially in cloud environments.


    11. Bootloader

    The bootloader helps load the operating system kernel.

    A common Linux bootloader is:

    GRUB

    Conceptually:

    Firmware
       ↓
    GRUB
       ↓
    Linux kernel

    Cloud environments may use different boot arrangements, so this is a general model rather than a universal sequence.


    12. Linux Kernel Starts

    The kernel is loaded into memory.

    Then it begins initializing the system.

    Conceptually:

    Linux kernel
        ↓
    CPU management
    Memory management
    Device initialization
    Networking
    Filesystem support
    Process management

    13. What Is a Process?

    A process is a running instance of a program managed by the operating system.

    For example:

    Program:
    nginx
    
    Running instance:
    nginx process

    Another example:

    Program:
    php-fpm
    
    Running instance:
    php-fpm worker process

    14. Program vs Process

    This distinction is important.

    Program

    A stored set of instructions.

    Example:

    /usr/sbin/nginx

    Process

    That program currently executing.

    nginx
       ↓
    Process
       ↓
    CPU + memory + OS resources

    So:

    Program = stored instructions
    
    Process = executing instance

    15. Multiple Processes

    A server can run many processes simultaneously.

    For example:

    Linux
     │
     ├── nginx
     ├── php-fpm
     ├── mysqld
     ├── sshd
     └── system services

    The kernel schedules CPU time among runnable processes.


    16. CPU Scheduling

    Suppose your CPU has work from:

    Nginx
    PHP
    MySQL
    SSH
    System services

    The kernel manages access to the CPU.

    Simplified:

    Process A
       ↓
    CPU
       ↓
    Process B
       ↓
    CPU
       ↓
    Process C
       ↓
    CPU

    Modern systems have multiple CPU cores, so multiple threads can execute simultaneously across cores.


    17. Threads

    A process can contain one or more threads of execution.

    Conceptually:

    Process
     ├── Thread 1
     ├── Thread 2
     └── Thread 3

    Threads share much of the process’s memory and resources.

    This becomes important for:

    Web servers
    Databases
    Operating systems
    Parallel computing

    18. RAM and Virtual Memory

    A process needs memory.

    The operating system provides each process with a virtual address space.

    Conceptually:

    Process
     ↓
    Virtual memory
     ↓
    Physical memory
     ↓
    RAM

    This is a major abstraction.

    A program generally doesn’t need to know the exact physical RAM location where every byte resides.

    The OS and CPU’s memory-management hardware handle the mapping.


    19. Memory Protection

    One process should not normally be able to freely modify another process’s memory.

    For example:

    Nginx
       X
    PHP memory

    and:

    PHP
       X
    MySQL memory

    The hardware and OS cooperate to provide memory isolation.

    This is a major part of system security and stability.


    20. Files

    The OS provides a filesystem interface.

    For example:

    ls

    asks the system to list directory contents.

    Conceptually:

    ls
     ↓
    Shell
     ↓
    System interface
     ↓
    Filesystem
     ↓
    Storage

    21. Directories

    Linux organizes files into a hierarchical directory structure.

    For example:

    /
    ├── etc
    ├── home
    ├── var
    ├── usr
    ├── tmp
    └── storage

    The root directory is:

    /

    Everything branches from it.


    22. Your Website Path

    You have used paths similar to:

    /storage/websites/templates.cresignsys.com/public/

    Break it down:

    /
    └── storage
        └── websites
            └── templates.cresignsys.com
                └── public

    This is simply a directory hierarchy managed by the Linux filesystem.


    23. Permissions

    Linux controls who can access files and resources.

    A file can have permissions for:

    Owner
    Group
    Others

    with permissions such as:

    Read
    Write
    Execute

    For example:

    rwx

    means:

    r = read
    w = write
    x = execute

    24. Users

    Linux supports multiple user identities.

    For example:

    root
    ubuntu
    www-data

    A process runs under a particular user identity.

    For example, web-server processes often run with restricted privileges such as:

    www-data

    rather than full root privileges.

    This reduces the impact of some security problems.


    25. Root

    The Linux root user has extremely powerful privileges.

    For example:

    sudo systemctl restart nginx

    may execute the requested operation with elevated privileges.

    Conceptually:

    Normal user
        ↓
    sudo
        ↓
    root privileges
        ↓
    Privileged operation

    Because root access is powerful, commands should be used carefully.


    26. What Is a Service?

    A service is a program or group of processes managed to provide a continuing system function.

    Examples:

    nginx
    mysql
    ssh
    php-fpm

    On modern Ubuntu systems, systemd commonly manages services.


    27. systemd

    systemd is the primary system and service manager used by Ubuntu.

    For example:

    systemctl status nginx

    asks systemd for the current state of the Nginx service.

    Conceptually:

    systemctl
       ↓
    systemd
       ↓
    Service
       ↓
    Process

    28. Starting a Service

    For example:

    sudo systemctl start nginx

    Conceptually:

    Command
     ↓
    systemctl
     ↓
    systemd
     ↓
    Nginx
     ↓
    Process starts

    29. Restarting a Service

    When you execute:

    sudo systemctl restart nginx

    the system roughly performs:

    Stop/reconfigure service
            ↓
    Start service
            ↓
    New/reloaded process state

    The exact internal sequence depends on the service and its unit configuration.


    30. Networking

    The operating system also manages network interfaces and networking functionality.

    Conceptually:

    Application
        ↓
    Socket
        ↓
    TCP/IP stack
        ↓
    Network driver
        ↓
    Network interface
        ↓
    Cable / fiber / radio

    This is the beginning of the path from your Linux server to the Internet.


    31. What Is a Socket?

    A socket is an operating-system interface that applications use for network communication.

    Conceptually:

    Nginx
     ↓
    Socket
     ↓
    TCP
     ↓
    IP
     ↓
    Network interface

    A server can listen on a network address and port.

    For example:

    HTTP  → 80
    HTTPS → 443

    32. What Is a Port?

    A port identifies a logical endpoint for network communication on a host.

    For example:

    Server IP
       +
    TCP port 443
       ↓
    HTTPS service

    Therefore:

    IP address
       ↓
    Which machine/interface?
    
    Port
       ↓
    Which network service?

    This distinction is fundamental to web hosting.


    33. Operating System and Web Hosting

    Now we can connect everything:

    Physical server
          ↓
    CPU / RAM / Storage / NIC
          ↓
    Firmware
          ↓
    Bootloader
          ↓
    Linux kernel
          ↓
    Ubuntu
          ↓
    systemd
          ↓
    Nginx
          ↓
    PHP-FPM
          ↓
    WordPress
          ↓
    MySQL

    And externally:

    Browser
       ↓
    Internet
       ↓
    Server IP
       ↓
    Port 443
       ↓
    Nginx
       ↓
    TLS
       ↓
    HTTP
       ↓
    WordPress

    34. Your SSL Certificate Fits Here

    You recently installed:

    templates.cresignsys.com

    with Let’s Encrypt.

    The architecture is:

    Browser
       ↓
    HTTPS
       ↓
    Port 443
       ↓
    Nginx
       ↓
    TLS certificate
       ↓
    Encrypted connection
       ↓
    HTTP request
       ↓
    WordPress

    Notice the important distinction:

    TLS is not the operating system.

    It operates at the networking/security layer above the basic OS networking facilities.


    35. The Complete Stack

    Your learning path is now:

    PHYSICS
     ↓
    Electrons
     ↓
    Electricity
     ↓
    Electronics
     ↓
    Semiconductors
     ↓
    Transistors
     ↓
    Digital logic
     ↓
    Binary
     ↓
    CPU
     ↓
    COMPUTER
     ↓
    Operating System
     ↓
    Linux
     ↓
    Processes
     ↓
    Memory
     ↓
    Filesystem
     ↓
    Networking
     ↓
    TCP/IP
     ↓
    TLS
     ↓
    HTTP
     ↓
    Nginx
     ↓
    PHP
     ↓
    WordPress
     ↓
    Web Hosting

    36. Quick Check

    What is an operating system?

    Software that manages hardware resources and provides services/abstractions for applications.

    What is the kernel?

    The privileged core of the operating system that manages fundamental system resources.

    What is a process?

    A running execution instance managed by the OS.

    What is RAM?

    Working memory used by running programs.

    What is a filesystem?

    A system for organizing and managing persistent files and directories.

    What is systemd?

    A system and service manager commonly used by Linux distributions such as Ubuntu.

    What does Nginx do?

    It can accept and process HTTP/HTTPS connections and serve or proxy web requests.


    Next Lesson — 016

    What Happens When You Type a Linux Command?

    We will take a real command:

    sudo systemctl restart nginx

    and trace it from your keyboard all the way down to the CPU and back:

    Keyboard
     ↓
    Terminal
     ↓
    Shell
     ↓
    Command parsing
     ↓
    sudo
     ↓
    system call
     ↓
    Linux kernel
     ↓
    systemd
     ↓
    Nginx
     ↓
    CPU
     ↓
    RAM
     ↓
    Filesystem
     ↓
    Network

    This will be the foundation for understanding every Linux command you use while managing your web-hosting server.

  • CresignSys Learn — Lesson 014

    Course: From Basic Science to Web Hosting

    Module 03 — Computer Fundamentals

    What Is a Computer?

    Difficulty: Beginner → Intermediate
    Prerequisites: Lesson 013 — What Is Binary?
    Estimated time: 30 minutes


    1. The Big Question

    We now know:

    Transistor
     ↓
    Switch
     ↓
    0 / 1
     ↓
    Bit
     ↓
    Data

    But how do billions of these tiny electrical switches become something that can:

    • run Linux,
    • run WordPress,
    • process network traffic,
    • execute PHP,
    • store databases,
    • and serve websites?

    The answer is:

    A Computer Is a System for Processing Information

    A simplified model is:

    INPUT
      ↓
    PROCESSING
      ↓
    MEMORY
      ↓
    OUTPUT

    But a real computer is more accurately understood as several cooperating subsystems.


    2. The Basic Computer Model

    A simplified computer contains:

                     COMPUTER
                        │
           ┌────────────┼────────────┐
           ↓            ↓            ↓
         CPU          Memory       I/O
           │            │            │
           └────────────┼────────────┘
                        ↓
                     Storage

    The major components are:

    CPU
    RAM
    Storage
    Input/Output
    Interconnects
    Power

    3. CPU

    CPU means:

    Central Processing Unit

    The CPU executes instructions.

    Conceptually:

    Instruction
        ↓
    CPU
        ↓
    Operation
        ↓
    Result

    The CPU contains structures such as:

    Control logic
    Arithmetic logic
    Registers
    Caches
    Execution units

    4. The CPU Is Made From Transistors

    Remember:

    Transistor
     ↓
    Logic gate
     ↓
    Digital circuit
     ↓
    CPU

    So the CPU is ultimately a highly complex semiconductor circuit.

    Conceptually:

    Silicon
     ↓
    Transistors
     ↓
    Logic gates
     ↓
    Functional units
     ↓
    CPU

    5. What Does the CPU Actually Do?

    A CPU repeatedly performs operations according to instructions.

    A simplified instruction cycle is:

    FETCH
      ↓
    DECODE
      ↓
    EXECUTE
      ↓
    WRITE BACK
      ↓
    NEXT INSTRUCTION

    This happens extremely rapidly.


    6. Fetch

    The CPU needs to obtain an instruction.

    Conceptually:

    Memory
      ↓
    Instruction
      ↓
    CPU

    The CPU uses a special register called the:

    Program Counter

    It indicates where the next instruction is located in the program’s address space.


    7. Decode

    The CPU determines what the instruction means.

    For example, conceptually:

    Instruction
         ↓
    Decode
         ↓
    ADD

    or:

    Instruction
         ↓
    Decode
         ↓
    LOAD

    or:

    Instruction
         ↓
    Decode
         ↓
    JUMP

    The exact instructions depend on the CPU architecture.


    8. Execute

    The CPU performs the operation.

    For an addition:

    5 + 3

    Conceptually:

    Registers
       ↓
    ALU
       ↓
    Addition
       ↓
    Result = 8

    9. ALU

    ALU means:

    Arithmetic Logic Unit

    It performs operations such as:

    Addition
    Subtraction
    AND
    OR
    XOR
    Comparison
    Bit operations

    Conceptually:

            ┌─────────────┐
    Input → │     ALU     │ → Result
            └─────────────┘

    10. Registers

    Registers are very fast storage locations inside the CPU.

    They hold values needed during computation.

    Conceptually:

    Register A → 5
    Register B → 3
    
            ↓
    
    ALU
    
            ↓
    
    Register C → 8

    Registers are much smaller than main memory but extremely important for CPU execution.


    11. Memory

    The CPU needs somewhere to store instructions and data.

    This is where memory comes in.

    A simplified hierarchy:

    CPU registers
         ↓
    CPU cache
         ↓
    RAM
         ↓
    SSD / storage

    As we move downward:

    Capacity generally increases
    Access speed generally decreases

    There are important architectural nuances, but this is a useful beginner model.


    12. RAM

    RAM means:

    Random Access Memory

    RAM is working memory used by the computer while programs are running.

    For example:

    Linux
     ↓
    RAM
    
    Nginx
     ↓
    RAM
    
    PHP
     ↓
    RAM
    
    WordPress
     ↓
    RAM

    RAM is generally volatile.

    That means its contents normally disappear when power is removed.


    13. Storage

    Storage keeps data persistently.

    Examples:

    SSD
    Hard disk
    Flash storage

    Conceptually:

    Storage
     ↓
    Files
     ↓
    Operating system
     ↓
    Applications
     ↓
    Website
     ↓
    Database

    Unlike ordinary RAM, persistent storage retains information when power is removed.


    14. RAM vs Storage

    This distinction is extremely important for server administration.

    RAMStorage
    Working memoryPersistent data
    Usually volatileNon-volatile
    Very fastSlower than CPU registers/cache
    SmallerUsually larger
    Running programs use itFiles are stored here

    For example:

    WordPress files
          ↓
    SSD
    
    Running WordPress/PHP processes
          ↓
    RAM

    15. Input and Output

    A computer also needs to communicate with the outside world.

    Examples:

    Keyboard
    Mouse
    Display
    USB
    Network interface
    Disk controller

    For a server, the network interface is particularly important.

    Internet
       ↓
    Network interface
       ↓
    Server

    16. Interconnects

    Computer components need to communicate.

    For example:

    CPU
     ↕
    Memory
     ↕
    Storage
     ↕
    Network

    These connections use electrical signaling and protocols.

    At the lowest level:

    Transistors
     ↓
    Electrical signals
     ↓
    Digital interfaces
     ↓
    Computer buses/interconnects

    17. The Motherboard

    In a traditional physical computer, the motherboard provides much of the physical infrastructure connecting components.

    Conceptually:

                 CPU
                  │
           ┌──────┼──────┐
           ↓      ↓      ↓
          RAM   Storage  Network

    Modern systems can integrate many of these functions into a smaller number of chips, but the conceptual organization remains useful.


    18. Power

    None of this works without energy.

    The power system converts electrical energy into appropriate voltage/current rails for the components.

    Conceptually:

    Electrical supply
          ↓
    Power supply
          ↓
    Voltage regulation
          ↓
    CPU / RAM / SSD / Network

    19. Computer Hardware vs Software

    This distinction is essential.

    Hardware

    Physical components:

    CPU
    RAM
    SSD
    Motherboard
    Network interface

    Software

    Instructions and data:

    Operating system
    Applications
    Libraries
    Configuration
    Website
    Database

    So:

    Hardware
       +
    Software
       ↓
    Computer system

    20. What Is an Operating System?

    The hardware needs software that manages resources and provides useful abstractions.

    That software is the:

    Operating System

    Examples:

    Linux
    Windows
    macOS
    Android

    For your web hosting environment, the important one is:

    Linux


    21. What Does Linux Do?

    Linux manages hardware resources and provides interfaces for applications.

    Conceptually:

    Applications
          ↓
    System calls
          ↓
    Linux kernel
          ↓
    Hardware

    For example:

    Nginx
     ↓
    Linux
     ↓
    Network hardware

    22. What Is the Kernel?

    The kernel is the central privileged part of an operating system.

    It manages resources such as:

    CPU
    Memory
    Processes
    Devices
    Networking
    Filesystems

    Conceptually:

    Applications
          ↓
    Kernel
          ↓
    Hardware

    23. What Is a Process?

    When you start a program, the operating system creates a running execution context called a process.

    For example:

    Nginx program
          ↓
    Nginx processes

    Similarly:

    PHP program
          ↓
    PHP-FPM processes

    A process has things such as:

    Code
    Memory
    State
    Resources
    Identifiers

    24. What Is a Program?

    A program is a set of instructions and associated data that can be executed by a computer.

    Conceptually:

    Program
     ↓
    Machine instructions
     ↓
    CPU
     ↓
    Execution

    25. What Is a File?

    A file is a persistent representation of data managed by a filesystem.

    Examples:

    index.html
    style.css
    wp-config.php
    image.jpg
    database backup

    On Linux:

    /storage/websites/

    is simply part of the filesystem hierarchy.


    26. What Is a Filesystem?

    A filesystem organizes persistent data into structures such as:

    Directories
    Files
    Metadata
    Permissions

    Conceptually:

    Disk
     ↓
    Filesystem
     ↓
    Directories
     ↓
    Files

    For example:

    /storage/websites/templates.cresignsys.com/public/

    can be understood as a path through the Linux filesystem.


    27. What Is a Server?

    A server is not necessarily a special type of physical machine.

    A server is fundamentally a system that provides a service to clients.

    For example:

    Web server
    DNS server
    Database server
    Mail server
    File server

    Your computer can technically act as a server.


    28. What Makes a Computer a Web Server?

    Install web-server software.

    For example:

    Computer
       ↓
    Linux
       ↓
    Nginx
       ↓
    Web service

    Nginx listens for network requests and sends appropriate responses.


    29. Client and Server

    Suppose you open:

    https://templates.cresignsys.com

    Your browser is the:

    CLIENT

    Your hosting machine is the:

    SERVER

    Conceptually:

    Browser
       │
       │ Request
       ↓
    Internet
       │
       ↓
    Server
       │
       │ Response
       ↓
    Browser

    30. The Web Server Stack

    Your website can involve several software layers:

    Internet
       ↓
    Network interface
       ↓
    Linux
       ↓
    Nginx
       ↓
    PHP-FPM
       ↓
    WordPress
       ↓
    MySQL

    Each component has a different responsibility.


    31. Nginx

    Nginx is web-server/reverse-proxy software.

    It can:

    Receive HTTP/HTTPS requests
    Serve static files
    Proxy requests
    Handle TLS
    Route requests
    Manage connections

    32. PHP

    WordPress is primarily written in PHP.

    Conceptually:

    Browser
     ↓
    Nginx
     ↓
    PHP-FPM
     ↓
    WordPress PHP code
     ↓
    Response

    33. MySQL

    WordPress needs a database.

    Conceptually:

    WordPress
        ↓
    Database query
        ↓
    MySQL
        ↓
    Data
        ↓
    WordPress

    The database can contain:

    Posts
    Pages
    Users
    Settings
    Metadata
    Plugins' data

    34. Your Hosting Stack

    The system you are building can therefore be visualized as:

    PHYSICAL / CLOUD INFRASTRUCTURE
                 ↓
            Virtual Machine
                 ↓
               Ubuntu
                 ↓
              Linux Kernel
                 ↓
             File System
                 ↓
               Nginx
              /     \
           HTTPS    HTTP
             ↓
          PHP-FPM
             ↓
         WordPress
             ↓
           MySQL
             ↓
           Website

    35. The Complete Journey

    You have now travelled from basic physics to a real web-hosting architecture:

    Matter
     ↓
    Atom
     ↓
    Electron
     ↓
    Electric charge
     ↓
    Electric field
     ↓
    Voltage
     ↓
    Current
     ↓
    Circuit
     ↓
    Semiconductor
     ↓
    Transistor
     ↓
    Logic
     ↓
    Binary
     ↓
    CPU
     ↓
    Computer
     ↓
    Operating System
     ↓
    Linux
     ↓
    Networking
     ↓
    Internet
     ↓
    HTTP/HTTPS
     ↓
    Nginx
     ↓
    PHP
     ↓
    WordPress
     ↓
    MySQL
     ↓
    Website
     ↓
    Web Hosting

    This is the CresignSys Learn technology path.


    36. Next Level

    The next lesson should not jump directly to web hosting yet.

    We should understand the layer immediately above the computer hardware:

    Lesson 015 — What Is an Operating System?

    We will go deeply into:

    Computer hardware
           ↓
    Boot process
           ↓
    Firmware
           ↓
    Bootloader
           ↓
    Linux kernel
           ↓
    Operating system
           ↓
    Processes
           ↓
    Memory
           ↓
    Filesystems
           ↓
    Users
           ↓
    Permissions
           ↓
    Services
           ↓
    Commands

    Then we will connect it directly to the commands you are already using on your Ubuntu web-hosting server.

  • CresignSys Learn — Lesson 013

    Course: From Basic Science to Web Hosting

    Module 03 — Digital Information

    What Is Binary?

    Difficulty: Beginner → Intermediate
    Prerequisites: Lesson 012 — How Does a Transistor Become a Switch?
    Estimated time: 25 minutes


    1. The Big Question

    We have reached an important point.

    We started with:

    Matter
     ↓
    Atoms
     ↓
    Electrons
     ↓
    Electricity
     ↓
    Semiconductors
     ↓
    Transistors
     ↓
    Switching

    Now we need to answer:

    How does a physical electrical switch become information?

    The answer begins with:

    Binary


    2. What Does Binary Mean?

    Binary is a base-2 number system.

    It uses only two symbols:

    0
    1

    Compare this with decimal:

    Decimal
    0 1 2 3 4 5 6 7 8 9

    Binary:

    Binary
    0 1

    3. Why Do Computers Use Binary?

    Computers are built from electronic circuits.

    Electronic circuits can be designed to reliably distinguish between two broad states:

    LOW
    HIGH

    These can be interpreted as:

    LOW  → 0
    HIGH → 1

    So:

    Physical voltage
          ↓
    Electrical state
          ↓
    Digital interpretation
          ↓
    0 or 1

    This is why binary is so useful.


    4. Binary Is an Abstraction

    Remember something very important:

    A computer does not contain tiny physical objects labeled “0” and “1.”

    The physical system contains things such as:

    Voltage
    Current
    Charge
    Electric fields
    Transistors
    Capacitances

    The computer’s digital circuits interpret physical states as logical values.

    Therefore:

    Physical world
          ↓
    Electrical state
          ↓
    Logical abstraction
          ↓
    0 / 1

    5. What Is a Bit?

    A bit is a binary digit.

    It can have two logical values:

    0
    1

    So:

    1 bit
     ↓
    2 possible states

    For example:

    0
    1

    6. Two Bits

    Now use two bits:

    00
    01
    10
    11

    There are:

    2² = 4

    possible combinations.


    7. Three Bits

    Three bits:

    000
    001
    010
    011
    100
    101
    110
    111

    There are:

    2³ = 8

    possible combinations.


    8. General Rule

    For n bits:

    Number of possible combinations = 2ⁿ

    Examples:

    1 bit  → 2 states
    2 bits → 4 states
    3 bits → 8 states
    4 bits → 16 states
    8 bits → 256 states

    This is one of the most important formulas in digital computing.


    9. What Is a Byte?

    A byte is conventionally:

    8 bits

    Example:

    10110101

    This contains:

    8 binary digits

    Therefore:

    1 byte = 8 bits

    10. Why 8 Bits?

    Eight bits provide:

    2⁸ = 256

    possible combinations.

    These combinations can represent:

    0 → 255

    when interpreted as an unsigned binary integer.


    11. Binary Place Values

    Decimal uses powers of 10:

    1000
    100
    10
    1

    Binary uses powers of 2:

    8
    4
    2
    1

    For four bits:

    Binary position:
    
    8    4    2    1
    ↓    ↓    ↓    ↓
    0    0    0    0

    12. Example: Binary 1011

    Take:

    1011

    Place values:

    8   4   2   1
    1   0   1   1

    Calculate:

    1×8
    +
    0×4
    +
    1×2
    +
    1×1

    Therefore:

    8 + 0 + 2 + 1 = 11

    So:

    1011₂ = 11₁₀

    13. Binary 1010

    8   4   2   1
    1   0   1   0

    Therefore:

    8 + 0 + 2 + 0 = 10

    So:

    1010₂ = 10₁₀

    14. Decimal to Binary

    Suppose we want to represent:

    13

    Using powers of two:

    8 + 4 + 1 = 13

    Therefore:

    8  4  2  1
    1  1  0  1

    So:

    13₁₀ = 1101₂

    15. Why Computers Need Binary

    Consider an electronic switch:

    OFF

    or:

    ON

    We can abstract it as:

    OFF → 0
    ON  → 1

    Now connect eight switching elements:

    Switch Switch Switch Switch Switch Switch Switch Switch
       ↓      ↓      ↓      ↓      ↓      ↓      ↓      ↓
       1      0      1      1      0      0      1      0

    We have:

    10110010

    That is a byte.


    16. From Transistor to Bit

    This is the critical connection:

    MOSFET
     ↓
    Switching behavior
     ↓
    Electrical HIGH/LOW
     ↓
    Logic state
     ↓
    0/1
     ↓
    Bit

    This is how physical electronics becomes digital information.


    17. Bits Can Represent Numbers

    For example:

    00000000 = 0
    00000001 = 1
    00000010 = 2
    00000011 = 3

    And:

    11111111 = 255

    for an unsigned 8-bit number.


    18. Bits Can Represent Text

    Computers also need to represent letters.

    A character encoding assigns numerical values to characters.

    For example, ASCII assigns:

    A = 65

    65 in binary is:

    01000001

    So conceptually:

    A
     ↓
    65
     ↓
    01000001
     ↓
    Bits
     ↓
    Electrical states

    19. Bits Can Represent Images

    An image can be represented using numbers.

    For a simple grayscale image:

    Pixel
     ↓
    Brightness value
     ↓
    Number
     ↓
    Binary

    A color image can use multiple numerical values per pixel.

    For example:

    Red
    Green
    Blue

    These values can all be represented using bits.


    20. Bits Can Represent Audio

    Sound is a physical phenomenon.

    A microphone converts sound pressure variations into an electrical signal.

    An analog-to-digital converter then samples and quantizes the signal.

    Conceptually:

    Sound
     ↓
    Microphone
     ↓
    Electrical signal
     ↓
    Sampling
     ↓
    Quantization
     ↓
    Binary data

    That binary data can be stored or transmitted.


    21. Bits Can Represent Video

    Video is essentially a sequence of images over time, usually accompanied by audio.

    Conceptually:

    Scene
     ↓
    Camera
     ↓
    Images + sound
     ↓
    Digital representation
     ↓
    Binary data
     ↓
    File / stream

    22. Bits Can Represent Programs

    This is even more important.

    A program is ultimately represented in a form the computer’s processor can execute.

    Simplified:

    Program
     ↓
    Source code
     ↓
    Compiler / interpreter / runtime
     ↓
    Machine instructions
     ↓
    Binary representation
     ↓
    CPU

    At the hardware level, instructions are encoded as bit patterns.


    23. What Is Machine Code?

    A CPU has an instruction set architecture (ISA).

    Instructions are encoded into machine-readable bit patterns.

    Conceptually:

    Instruction
     ↓
    Binary encoding
     ↓
    CPU
     ↓
    Decode
     ↓
    Execute

    For example, a processor might have instructions conceptually corresponding to:

    LOAD
    ADD
    STORE
    JUMP
    COMPARE

    The actual binary encodings depend on the processor architecture.


    24. Binary Is Not the Same as Machine Code

    This distinction is important.

    Binary is a number representation system.

    Machine code is encoded processor instructions/data interpreted according to a specific instruction set architecture.

    So:

    Binary
     ↓
    General representation system

    while:

    Machine code
     ↓
    Specific encoding understood by a CPU architecture

    25. Bits in Memory

    Suppose a memory system stores:

    10110010

    Physically, the memory cell isn’t simply a tiny box containing “10110010.”

    It uses physical states.

    Depending on memory technology, information may be represented through things such as:

    Charge
    Voltage
    Transistor state
    Magnetic state

    Again:

    Physical state
          ↓
    Electrical interpretation
          ↓
    Logical bit

    26. Bits Traveling Through a Network

    Now we reach networking.

    Suppose your browser requests:

    https://templates.cresignsys.com

    The information must travel through networks.

    Conceptually:

    Computer
     ↓
    Network interface
     ↓
    Electrical / optical / radio signal
     ↓
    Network
     ↓
    Router
     ↓
    Internet
     ↓
    Server

    The physical signals represent digital information.


    27. The Signal Is Not Literally “1 and 0”

    This is another important distinction.

    An Ethernet cable doesn’t contain little physical 1s and 0s traveling through it as objects.

    Instead:

    Binary information
          ↓
    Encoded signal
          ↓
    Electrical waveform
          ↓
    Cable

    At the receiving end:

    Electrical waveform
          ↓
    Receiver
          ↓
    Signal processing
          ↓
    Decoded bits

    28. Optical Fiber

    For fiber:

    Bits
     ↓
    Electrical signal
     ↓
    Optical transmitter
     ↓
    Light modulation
     ↓
    Fiber
     ↓
    Photodetector
     ↓
    Electrical signal
     ↓
    Bits

    Therefore the Internet combines:

    Digital information
    +
    Physical signals

    29. Wireless

    Wi-Fi uses electromagnetic waves.

    Conceptually:

    Bits
     ↓
    Digital processing
     ↓
    Radio modulation
     ↓
    Electromagnetic wave
     ↓
    Air
     ↓
    Radio receiver
     ↓
    Demodulation
     ↓
    Bits

    So the same binary information can travel through:

    Copper
    Fiber
    Radio

    using different physical signaling technologies.


    30. From Binary to Web Hosting

    Now we can connect the entire chain:

    Transistor
     ↓
    Switch
     ↓
    0 / 1
     ↓
    Bit
     ↓
    Byte
     ↓
    Data
     ↓
    Machine instructions
     ↓
    CPU
     ↓
    Operating system
     ↓
    Network protocols
     ↓
    Internet
     ↓
    HTTP/HTTPS
     ↓
    Web server
     ↓
    Website
     ↓
    Web hosting

    31. Your WordPress Website

    When WordPress serves a page, enormous amounts of digital information are being processed.

    For example:

    Browser request
          ↓
    Network packets
          ↓
    Server network interface
          ↓
    Linux
          ↓
    Nginx
          ↓
    PHP
          ↓
    WordPress
          ↓
    MySQL
          ↓
    HTML/CSS/JS
          ↓
    Network
          ↓
    Browser

    At the lowest hardware level:

    Software
     ↓
    CPU instructions
     ↓
    Transistors
     ↓
    Electrical signals

    32. The Big Picture

    You have now crossed another major boundary:

    PHYSICAL WORLD
           ↓
    Electricity
           ↓
    Electronics
           ↓
    Transistors
           ↓
    DIGITAL WORLD
           ↓
    Bits
           ↓
    Data
           ↓
    Programs
           ↓
    Operating systems
           ↓
    NETWORK WORLD
           ↓
    Packets
           ↓
    Internet
           ↓
    WEB
           ↓
    WEB HOSTING

    33. What You Should Remember

    The most important chain from today’s lesson is:

    Transistor
       ↓
    Electrical state
       ↓
    HIGH / LOW
       ↓
    Logical 1 / 0
       ↓
    Bit
       ↓
    Byte
       ↓
    Data

    And:

    Binary is the mathematical representation; the hardware uses physical electrical states to implement it.


    34. Quick Check

    What is binary?

    A base-2 number system using 0 and 1.

    What is a bit?

    A binary digit representing one logical binary state.

    How many states can 8 bits represent?

    2⁸ = 256

    How many values can an unsigned 8-bit number represent?

    0–255

    What is a byte?

    8 bits.

    Can binary represent text?

    Yes, through character encodings.

    Can binary represent images?

    Yes.

    Can binary represent programs?

    Yes.

    Does a network cable physically contain 0s and 1s?

    No. It carries physical signals that encode digital information.


    Next Lesson

    Lesson 014 — What Is a Computer?

    Now we assemble everything we have learned:

    Transistors
          ↓
    Logic gates
          ↓
    Digital circuits
          ↓
    ALU
          ↓
    Registers
          ↓
    CPU
          ↓
    RAM
          ↓
    Storage
          ↓
    Motherboard
          ↓
    Computer

    Then we will continue:

    Computer
     ↓
    Operating System
     ↓
    Linux
     ↓
    Processes
     ↓
    Files
     ↓
    Networking
     ↓
    Server
     ↓
    Web Hosting

    This is where the course starts moving from electronics into computer engineering and operating systems.

  • CresignSys Learn — Lesson 012

    Course: From Basic Science to Web Hosting

    Module 02 — Electronics → Digital Electronics

    How Does a Transistor Become a Switch?

    Difficulty: Beginner → Intermediate
    Prerequisites: Lesson 011 — What Is a Transistor?
    Estimated time: 30 minutes


    1. The Big Question

    We know:

    Semiconductor
     ↓
    Transistor

    But how does a physical transistor become something a computer can use?

    The key idea is:

    A transistor can be controlled so that a circuit has two useful operating states.

    We can call these states:

    ON
    OFF

    Digital electronics interprets these physical states as logical states such as:

    ON  → 1
    OFF → 0

    The actual hardware uses voltage and current ranges, not abstract numbers floating around inside the transistor.


    2. Think About an Ordinary Switch

    Start with something simple.

           Switch
             ↓
    
    ON:
    
    ──────────────
    
    OFF:
    
    ──────  /  ────

    When ON:

    Electrical path
          ↓
    Connected
          ↓
    Current can flow

    When OFF:

    Electrical path
          ↓
    Disconnected/high resistance
          ↓
    Current is strongly restricted

    A transistor can perform a similar function without mechanically moving a physical switch.


    3. Mechanical Switch vs Electronic Switch

    Mechanical switch

    Physical movement
          ↓
    Contacts connect/disconnect

    Transistor switch

    Electrical control
          ↓
    Electric field
          ↓
    Semiconductor behavior changes
          ↓
    Current path changes

    Therefore:

    A transistor is an electronic switch.


    4. Why Use a Transistor?

    A mechanical switch is relatively slow and physically large.

    A transistor can be:

    Very small
    Very fast
    Repeated billions of times
    Manufactured in enormous quantities

    And millions or billions can be fabricated on one semiconductor chip.


    5. The MOSFET

    For understanding modern computers, we will focus mainly on the MOSFET.

    Its three primary terminals are:

    Gate
    Source
    Drain

    Conceptually:

                 Gate
                  │
                  ▼
            ┌───────────┐
            │           │
    Source ─┤  Channel  ├─ Drain
            │           │
            └───────────┘

    The gate controls the channel.


    6. The Gate Is the Control

    The important idea is:

    Gate voltage
          ↓
    Electric field
          ↓
    Semiconductor channel changes
          ↓
    Source-drain current changes

    The gate therefore controls whether the transistor provides a strong conduction path between source and drain.


    7. NMOS

    One of the two fundamental transistor types used in CMOS logic is the:

    NMOS transistor

    A simplified conceptual model:

    Gate = LOW
         ↓
    Channel OFF
         ↓
    Source-Drain conduction strongly restricted

    and:

    Gate = HIGH
         ↓
    Channel ON
         ↓
    Source-Drain conduction enabled

    This is a simplified digital model. Real MOSFET operation is continuous and depends on voltage, current, threshold voltage, device geometry, and other factors.


    8. Threshold Voltage

    A MOSFET has a parameter called the:

    Threshold voltage

    Often written:

    Vth

    For an NMOS, when the gate-to-source voltage is sufficiently above the threshold under appropriate conditions, a conducting inversion channel forms.

    Conceptually:

    VGS < Vth
         ↓
    Mostly OFF
    
    VGS > Vth
         ↓
    Channel forms
         ↓
    Can conduct

    This is a simplified switching model.


    9. What Actually Happens?

    Suppose we have an NMOS.

    Initially:

    Gate
      │
     LOW
      │
    
    Source ─────── Drain
           no strong
           channel

    Now raise the gate voltage.

    Gate
      │
     HIGH
      │
    Electric field
          ↓
    Channel forms
          ↓
    Source ───────── Drain

    The electric field created by the gate changes the carrier distribution near the semiconductor surface.

    That is the physical basis of MOSFET switching.


    10. The Gate Does Not Need to Be a Mechanical Connection

    This is one of the most important ideas.

    The gate controls the channel primarily through an electric field.

    Simplified:

    Gate
     │
     │ Electric field
     ↓
    Semiconductor
     │
     ↓
    Channel

    Therefore the device is called:

    Field-Effect Transistor


    11. PMOS

    The complementary transistor is:

    PMOS

    Its switching behavior is opposite in the basic CMOS logic model.

    Conceptually:

    Input LOW
        ↓
    PMOS ON

    and:

    Input HIGH
        ↓
    PMOS OFF

    This complementary behavior is extremely important.


    12. NMOS + PMOS

    Now combine them.

                 VDD
                  │
                 PMOS
                  │
                  ├──── Output
                  │
                 NMOS
                  │
                 GND

    Both transistor gates are connected to the same input.

                 Input
                   │
            ┌──────┴──────┐
            ↓             ↓
           PMOS          NMOS
            │             │
            └──────┬──────┘
                   ↓
                 Output

    This is a CMOS inverter.


    13. What Is an Inverter?

    An inverter is another name for a:

    NOT gate

    Its job is:

    Input → opposite logical state → Output

    Truth table:

    InputOutput
    01
    10

    14. CMOS NOT Gate — Input = 0

    Suppose:

    Input = LOW

    Then approximately:

    PMOS → ON
    NMOS → OFF

    The circuit becomes conceptually:

           VDD
            │
          PMOS ON
            │
            ├──── Output
            │
          NMOS OFF
            │
           GND

    The output is pulled toward:

    VDD

    Therefore:

    Input  = 0
    Output = 1

    15. CMOS NOT Gate — Input = 1

    Now:

    Input = HIGH

    Approximately:

    PMOS → OFF
    NMOS → ON

    Conceptually:

           VDD
            │
          PMOS OFF
            │
            ├──── Output
            │
          NMOS ON
            │
           GND

    The output is pulled toward:

    GND

    Therefore:

    Input  = 1
    Output = 0

    16. The Complete Operation

                     VDD
                      │
                    PMOS
                      │
                      ├──── OUTPUT
                      │
                    NMOS
                      │
                     GND
                      ▲
                      │
                    INPUT

    Input LOW

    PMOS → ON
    NMOS → OFF
    
    Output → HIGH

    Input HIGH

    PMOS → OFF
    NMOS → ON
    
    Output → LOW

    Therefore:

    0 → 1
    1 → 0

    That is digital logic.


    17. Why Two Transistors?

    A natural question is:

    Why not use only one transistor?

    CMOS uses complementary devices so that, ideally, one device pulls the output high while the other pulls it low.

    This provides:

    Strong HIGH
    Strong LOW
    Low static power
    Good noise margins
    High scalability

    There are still real power losses during switching and due to leakage.


    18. What Is VDD?

    In digital electronics, the positive supply voltage is commonly labeled:

    VDD

    The reference/low supply is often:

    GND

    So:

    VDD → HIGH supply
    GND → LOW reference

    For example, a particular digital circuit might use:

    VDD = 1.0 V

    Another technology might use a different voltage.

    The voltage depends on the semiconductor process and circuit design.


    19. What Is a Logic Level?

    The computer doesn’t require exactly:

    0.000000 V = 0

    and:

    1.000000 V = 1

    Instead, circuits define ranges.

    For example, conceptually:

    LOW range
    0 V ─────────────
    
    HIGH range
    ──────────── 1 V

    The exact limits depend on the technology.

    Therefore:

    Digital logic is built from physical electrical ranges that are interpreted as discrete logical states.


    20. Noise

    Real electronic systems contain unwanted electrical disturbances.

    Suppose the intended LOW is near:

    0 V

    but noise moves it slightly:

    0 V → 0.05 V

    The circuit should still recognize it as LOW.

    Likewise, a HIGH signal can vary somewhat and still be recognized as HIGH.

    This tolerance is called a:

    Noise Margin

    This is essential for reliable digital computers.


    21. From One NOT Gate to More Logic

    One inverter gives:

    NOT

    But we need more operations.

    By connecting transistors appropriately, we can build:

    AND
    OR
    NAND
    NOR
    XOR
    XNOR

    For example:

    Transistors
        ↓
    NAND gate
        ↓
    AND + NOT

    22. Why NAND Is Important

    NAND is functionally complete.

    This means:

    Any Boolean logic function can be constructed from NAND gates alone.

    Therefore:

    NAND
     ↓
    NAND
     ↓
    NAND
     ↓
    ...

    can theoretically be combined to construct arbitrary digital logic.


    23. From Logic Gates to Arithmetic

    Now combine logic gates.

    We can create circuits that perform:

    Addition
    Subtraction
    Comparison
    Selection
    Counting

    For example:

    Logic gates
        ↓
    Half adder
        ↓
    Full adder
        ↓
    Adder circuits
        ↓
    Arithmetic Logic Unit

    The ALU is an important part of a CPU.


    24. From Logic to Memory

    Logic gates can also be connected to create circuits that retain state.

    Conceptually:

    Logic gates
         ↓
    Feedback
         ↓
    State
         ↓
    Memory element

    Examples include:

    Latch
    Flip-flop
    Register

    Now we have both:

    Computation
    +
    Memory

    25. Why Memory Is Necessary

    Imagine a calculator.

    To calculate:

    25 + 17

    the system needs to manipulate values and retain intermediate information.

    A computer therefore needs:

    Logic
    +
    Storage
    +
    Control

    26. From Gates to a CPU

    The hierarchy becomes:

    MOSFET
       ↓
    CMOS transistor circuits
       ↓
    Logic gates
       ↓
    Combinational logic
       ↓
    Sequential logic
       ↓
    Registers
       ↓
    ALU
       ↓
    Control unit
       ↓
    CPU

    Now we are getting very close to understanding what a processor actually is.


    27. One Transistor vs Billions

    One transistor:

    Electronic switch

    Thousands of transistors:

    Complex circuits

    Millions/billions of transistors:

    Highly complex integrated circuits

    Modern CPUs contain billions of transistors arranged into extremely complex structures.


    28. Where Are These Transistors?

    They are fabricated on a semiconductor wafer.

    Simplified manufacturing path:

    Silicon
     ↓
    Wafer
     ↓
    Thin films
     ↓
    Lithography
     ↓
    Doping
     ↓
    Etching
     ↓
    Deposition
     ↓
    Many repeated processing steps
     ↓
    Integrated circuit

    We will study semiconductor manufacturing much later.


    29. Why This Matters to Your Server

    Your web server contains CPUs.

    Those CPUs contain integrated circuits.

    Those integrated circuits contain enormous numbers of transistors.

    So when you execute:

    sudo systemctl restart nginx

    the chain ultimately looks like:

    Your command
     ↓
    Shell
     ↓
    Linux
     ↓
    CPU instructions
     ↓
    Processor circuits
     ↓
    Transistor switching
     ↓
    Physical electrical activity

    This is the connection between your basic-science lessons and actual web hosting.


    30. Full Learning Chain So Far

    You have now reached:

    Matter
     ↓
    Atom
     ↓
    Electron
     ↓
    Charge
     ↓
    Electric field
     ↓
    Voltage
     ↓
    Current
     ↓
    Circuit
     ↓
    Resistance
     ↓
    Capacitance
     ↓
    Inductance
     ↓
    Semiconductor
     ↓
    P-type / N-type
     ↓
    PN junction
     ↓
    Diode
     ↓
    Transistor
     ↓
    MOSFET
     ↓
    Electronic switch
     ↓
    CMOS
     ↓
    Logic gate

    Next:

    Logic gate
     ↓
    Boolean logic
     ↓
    Binary
     ↓
    Adder
     ↓
    Memory
     ↓
    CPU
     ↓
    Machine instructions
     ↓
    Operating system
     ↓
    Networking
     ↓
    Internet
     ↓
    Web server
     ↓
    Web hosting

    31. Quick Check

    1. What controls a MOSFET?

    The electric field produced by the gate voltage controls the channel.

    2. What are the three main MOSFET terminals?

    Gate
    Source
    Drain

    3. What does an NMOS generally do when its gate is driven HIGH?

    It can form a conducting channel and pull a suitable output toward the low rail.

    4. What does a PMOS generally do when its gate is driven LOW?

    It can conduct and pull a suitable output toward the high supply.

    5. What does a CMOS inverter do?

    Input 0 → Output 1
    Input 1 → Output 0

    6. What is a transistor in digital electronics?

    A controllable electronic switching device.

    7. What comes after transistor switching?

    Transistor
     ↓
    Logic gate
     ↓
    Digital logic

    Next Lesson

    Lesson 013 — What Is Binary?

    Now we move from electronics into information science.

    We will build the bridge:

    Transistor
     ↓
    HIGH / LOW
     ↓
    0 / 1
     ↓
    Bit
     ↓
    Binary number
     ↓
    Byte
     ↓
    ASCII
     ↓
    Data
     ↓
    Instructions
     ↓
    Machine code
     ↓
    CPU

    This lesson is especially important because it explains how physical electrical states become the digital information that computers, servers, websites, and networks process.

  • CresignSys Learn — Lesson 011

    Course: From Basic Science to Web Hosting

    Module 02 — Electronics

    What Is a Transistor?

    Difficulty: Beginner
    Prerequisites: Lesson 010 — What Is a Diode?
    Estimated time: 30 minutes


    1. Learning Objectives

    After this lesson, you should understand:

    • What a transistor is
    • Why transistors were invented
    • The basic types of transistors
    • How a transistor controls current
    • The transistor as a switch
    • The transistor as an amplifier
    • What MOSFET means
    • How transistors represent digital states
    • How transistors become logic gates
    • How logic gates eventually become CPUs

    2. Why Do We Need a Transistor?

    We already have a diode.

    A diode can provide:

    One-way / asymmetric current behavior

    But computers need something more powerful.

    We need a device that can be controlled.

    For example:

    Control signal
          ↓
    Transistor
          ↓
    Large electrical effect

    This gives us the fundamental idea of a transistor:

    A transistor is a semiconductor device that can control electrical current or voltage.


    3. The Big Idea

    Think of a transistor as a controllable electronic element.

    Conceptually:

                 CONTROL
                    │
                    ▼
    INPUT ─────► TRANSISTOR ─────► OUTPUT

    A small change in one part of the device can control a much larger electrical behavior.

    This is why transistors are useful for:

    Switching
    Amplification
    Signal processing
    Logic
    Memory
    Control

    4. Two Major Families

    There are two major transistor families:

    Transistors
    │
    ├── BJT
    │   └── Bipolar Junction Transistor
    │
    └── FET
        └── Field-Effect Transistor

    The most important FET for modern digital electronics is:

    MOSFET

    which means:

    Metal-Oxide-Semiconductor Field-Effect Transistor


    5. BJT

    A BJT has three terminals:

    Base
    Collector
    Emitter

    There are two common types:

    NPN
    PNP

    Simplified NPN structure:

    N-type
       │
    P-type
       │
    N-type

    So:

    Collector
        │
        N
        │
        P
        │
        N
        │
    Emitter

    The base is the thin middle region.


    6. BJT Control

    In a BJT, the base-emitter conditions control the collector-emitter current.

    Simplified:

    Small base control
           ↓
    Transistor
           ↓
    Collector-emitter current

    This makes the BJT useful as both an amplifier and a switch.


    7. FET

    A Field-Effect Transistor controls current using an electric field.

    Its basic terminals are:

    Gate
    Source
    Drain

    Conceptually:

            Gate
             │
             ▼
         ┌────────┐
         │        │
    Source      Drain

    The gate controls the electrical behavior of the channel between source and drain.


    8. MOSFET

    A MOSFET contains an insulating layer between the gate and the semiconductor.

    Simplified:

              Gate
         ─────────────
            Insulator
         ─────────────
           Semiconductor
         Source       Drain

    The gate’s electric field controls the channel.

    This is one reason MOSFETs are extremely important in modern integrated circuits.


    9. Why MOSFETs Are So Important

    Modern CPUs, GPUs, memory chips, and many other integrated circuits are primarily built using enormous numbers of MOSFET-based structures.

    The fundamental concept is:

    Gate voltage
         ↓
    Electric field
         ↓
    Channel behavior
         ↓
    Current control

    10. MOSFET as a Switch

    This is the most important idea for understanding computers.

    Imagine a simple switch:

    OFF
    
    ────  X  ────

    and:

    ON
    
    ──────────────

    A MOSFET can behave approximately like a controllable electronic switch.

    Control
       ↓
    MOSFET
       ↓
    ON / OFF

    11. From Switch to Binary

    Digital electronics needs two distinguishable states.

    We can represent them as:

    OFF → 0
    ON  → 1

    Therefore:

    Transistor
        ↓
    Electronic switching
        ↓
    Two-state logic
        ↓
    0 / 1

    This is the bridge from electronics to digital computing.


    12. Important Correction

    A transistor does not literally create a mathematical 0 or 1.

    The physical circuit has continuous electrical quantities such as:

    Voltage
    Current
    Electric field
    Charge

    Digital electronics defines voltage ranges that are interpreted as logical states.

    Conceptually:

    Low voltage range
          ↓
    Logical 0

    and:

    High voltage range
          ↓
    Logical 1

    This distinction is fundamental.


    13. One Transistor Is Not a Computer

    A single transistor can perform useful electrical control.

    But one transistor cannot perform an entire modern computation.

    We combine transistors.

    1 transistor
          ↓
    Switching element
    
    Several transistors
          ↓
    Circuit
    
    Many transistors
          ↓
    Logic gates
    
    Many logic gates
          ↓
    Digital systems

    14. What Is a Logic Gate?

    A logic gate is a digital circuit that performs a logical operation.

    For example:

    AND
    OR
    NOT
    NAND
    NOR
    XOR

    These circuits are constructed from transistors.


    15. NOT Gate

    A NOT gate reverses a logical state.

    Input → NOT → Output

    If:

    Input = 0

    then:

    Output = 1

    If:

    Input = 1

    then:

    Output = 0

    Truth table:

    InputOutput
    01
    10

    16. NAND Gate

    A NAND gate is:

    AND
     ↓
    NOT

    Its truth table:

    ABNAND
    001
    011
    101
    110

    NAND is particularly important because NAND gates are functionally complete.

    That means arbitrary Boolean logic can be constructed using NAND gates alone.


    17. Transistors Build Logic

    A simplified conceptual chain:

    MOSFET
      ↓
    Transistor switch
      ↓
    CMOS circuit
      ↓
    Logic gate
      ↓
    Digital circuit

    Modern digital integrated circuits commonly use CMOS, which stands for:

    Complementary Metal-Oxide-Semiconductor.


    18. What Is CMOS?

    CMOS uses complementary transistor types, typically:

    PMOS
    +
    NMOS

    Together they can implement efficient digital logic.

    A simplified CMOS inverter contains:

            VDD
             │
           PMOS
             │
             ├──── Output
             │
           NMOS
             │
            GND

    Both gates receive the input.


    19. CMOS Inverter Operation

    Input LOW

    Input = 0

    The PMOS is conducting and the NMOS is largely off.

    Result:

    Output ≈ HIGH

    Therefore:

    0 → 1

    Input HIGH

    Input = 1

    The PMOS is largely off and the NMOS conducts.

    Result:

    Output ≈ LOW

    Therefore:

    1 → 0

    This creates a NOT gate.


    20. Why CMOS Is Powerful

    CMOS logic can achieve very low static power consumption in idealized steady-state operation because ideally there is little direct current from the supply to ground when the circuit is not switching.

    Real circuits still consume power because of:

    Switching
    Leakage
    Short-circuit currents
    Interconnects
    Memory activity

    21. Switching Power

    When a transistor circuit switches, capacitances have to charge and discharge.

    This connects directly to Lesson 007.

    Transistor switches
           ↓
    Capacitive nodes charge/discharge
           ↓
    Energy consumption
           ↓
    Heat

    A commonly used approximate relationship for dynamic power is:

    P ≈ α C V² f

    where:

    α = activity factor
    C = effective capacitance
    V = voltage
    f = switching frequency

    This is one reason CPU power depends strongly on voltage, capacitance, activity, and frequency.


    22. Transistors as Amplifiers

    A transistor isn’t only a switch.

    It can also operate in an analog region where a small input change controls a larger output change.

    Conceptually:

    Small signal
         ↓
    Transistor
         ↓
    Larger controlled output signal

    This is amplification.

    Amplifiers are used in:

    Audio
    Radio
    Sensors
    Communication
    Instrumentation

    23. Digital vs Analog Operation

    A transistor can be used in different operating regimes.

    Transistor
    │
    ├── Analog operation
    │      ↓
    │   Amplification
    │
    └── Digital operation
           ↓
        Switching

    This distinction is important.

    Modern computers primarily use transistors as extremely fast switching elements within digital circuits, although analog behavior is fundamental to the physical operation of those circuits.


    24. How Fast Can a Transistor Switch?

    Very quickly.

    Modern semiconductor devices can switch on extremely short timescales.

    But switching speed is limited by factors including:

    Device physics
    Capacitance
    Resistance
    Interconnects
    Power
    Heat
    Signal integrity
    Manufacturing technology

    So faster isn’t simply a matter of “making the transistor turn on faster.”


    25. From Transistors to Memory

    Transistors can also be used to build memory.

    For example:

    Transistors
         ↓
    Memory cell
         ↓
    Stored state
         ↓
    Bits

    Different memory technologies use different physical mechanisms.

    Examples include:

    SRAM
    DRAM
    Flash

    We will study these later.


    26. From Transistors to CPU

    Now combine the concepts:

    Transistor
        ↓
    Logic gate
        ↓
    Combinational logic
        ↓
    Sequential logic
        ↓
    Registers
        ↓
    Arithmetic circuits
        ↓
    Control circuits
        ↓
    CPU

    A CPU is therefore not one giant transistor.

    It is an enormous integrated system containing vast numbers of transistors arranged into functional circuits.


    27. What Is an Integrated Circuit?

    An integrated circuit (IC) places many electronic components onto a semiconductor die.

    Conceptually:

    Silicon wafer
          ↓
    Integrated circuit
          ↓
    Millions / billions of devices
          ↓
    Complex electronic system

    Modern processors can contain billions of transistors.


    28. From CPU to Computer

    A CPU alone is not the entire computer.

    A computer system includes things such as:

    CPU
    RAM
    Storage
    Motherboard
    Power system
    Network interface
    Input/output devices

    Conceptually:

    Transistors
       ↓
    ICs
       ↓
    CPU + Memory + Controllers
       ↓
    Computer

    29. From Computer to Server

    A server is fundamentally a computer providing services to other systems.

    Computer
       ↓
    Operating System
       ↓
    Server software
       ↓
    Network
       ↓
    Clients

    For a web server:

    Computer
       ↓
    Linux
       ↓
    Nginx
       ↓
    Website

    30. From Server to Web Hosting

    Now we reach the direction of our course.

    Transistor
     ↓
    Integrated circuit
     ↓
    CPU
     ↓
    Computer
     ↓
    Server
     ↓
    Linux
     ↓
    Networking
     ↓
    Internet
     ↓
    Nginx
     ↓
    Website
     ↓
    Web hosting

    The connection between a transistor and your WordPress hosting server is now much clearer.


    31. A Full Technology Stack

    You can now visualize the entire hierarchy:

    PHYSICS
       ↓
    Electric charge
       ↓
    Electromagnetism
       ↓
    ELECTRICAL ENGINEERING
       ↓
    Circuits
       ↓
    ELECTRONICS
       ↓
    Semiconductors
       ↓
    Diodes
       ↓
    Transistors
       ↓
    DIGITAL ELECTRONICS
       ↓
    Logic gates
       ↓
    Memory
       ↓
    Processors
       ↓
    COMPUTER ENGINEERING
       ↓
    Computers
       ↓
    OPERATING SYSTEMS
       ↓
    Linux
       ↓
    NETWORKING
       ↓
    TCP/IP
       ↓
    INTERNET
       ↓
    WEB
       ↓
    HTTP / HTTPS
       ↓
    WEB SERVER
       ↓
    NGINX / PHP / MySQL
       ↓
    WEB HOSTING

    32. Why This Lesson Is a Major Milestone

    You started with:

    Matter

    and have now reached:

    Transistor

    The progression was:

    Matter
     ↓
    Atom
     ↓
    Electron
     ↓
    Charge
     ↓
    Electric field
     ↓
    Voltage
     ↓
    Current
     ↓
    Circuit
     ↓
    Resistance
     ↓
    Capacitance
     ↓
    Inductance
     ↓
    Semiconductor
     ↓
    PN junction
     ↓
    Diode
     ↓
    Transistor

    Now the next major question is:

    How do transistors become a computer’s logic?


    33. Quick Check

    What is a transistor?

    A semiconductor device used to control electrical current or voltage.

    What are two major transistor families?

    BJT
    FET

    What is a MOSFET?

    A metal-oxide-semiconductor field-effect transistor.

    What are the basic MOSFET terminals?

    Gate
    Source
    Drain

    What can a transistor do?

    Switch
    Amplify
    Control signals

    What is a logic gate?

    A digital circuit that performs a logical operation.

    What is CMOS?

    Complementary Metal-Oxide-Semiconductor logic using complementary transistor types, typically PMOS and NMOS.

    What comes after transistors?

    Transistors
       ↓
    Logic gates
       ↓
    Digital circuits

    Next Lesson

    Lesson 012 — How Does a Transistor Become a Switch?

    We will go one level deeper into the actual operation:

    MOSFET
      ↓
    Gate
      ↓
    Electric field
      ↓
    Channel
      ↓
    Source
      ↓
    Drain
      ↓
    ON
      ↓
    OFF
      ↓
    Voltage levels
      ↓
    0 and 1

    Then we will build a real CMOS NOT gate conceptually from two MOSFETs, which is the next step toward understanding how a CPU actually performs computation.

  • CresignSys Learn — Lesson 010

    Course: From Basic Science to Web Hosting

    Module 02 — Electronics

    What Is a Diode?

    Difficulty: Beginner
    Prerequisites: Lesson 009 — What Is a Semiconductor?
    Estimated time: 25 minutes


    1. Learning Objectives

    After this lesson, you should understand:

    • What a diode is
    • How a PN junction works
    • What the depletion region is
    • Forward bias and reverse bias
    • How a diode controls current
    • The diode I–V characteristic
    • Rectification
    • Common types of diodes
    • Why diodes are important in power supplies and computers

    2. Start With the PN Junction

    From the previous lesson:

    P-type semiconductor
            │
            │
    N-type semiconductor

    When P-type and N-type semiconductor regions are joined, we obtain a:

    PN Junction

    The PN junction is the fundamental structure behind an ordinary semiconductor diode.


    3. What Happens at the Junction?

    The P side has many holes as majority carriers.

    The N side has many electrons as majority carriers.

    Near the boundary:

    P-side              N-side
    
    holes  → ← electrons
              │
              │
           Junction

    Electrons and holes recombine near the junction.

    This leaves behind charged dopant ions that are relatively immobile.

    A region with very few mobile carriers forms:

    Depletion Region

    P-type       Depletion       N-type
    ███████      ░░░░░░░░░      ███████
    ███████      ░░░░░░░░░      ███████

    4. The Depletion Region

    The depletion region contains very few mobile charge carriers compared with the surrounding regions.

    Because of the fixed ionized dopants, an internal electric field develops.

    Conceptually:

    Carrier diffusion
           ↓
    Charge separation
           ↓
    Electric field
           ↓
    Potential barrier

    This barrier affects the movement of carriers across the junction.


    5. What Is a Diode?

    A diode is a semiconductor device designed to provide strongly asymmetric current-voltage behavior.

    In simple terms:

    A diode allows current much more readily in one direction than the other, within its normal operating range.

    The schematic symbol is:

    ──────|>|──────

    The exact symbol orientation indicates the diode’s polarity.


    6. Anode and Cathode

    A diode has two terminals:

    Anode
      │
      ▼
     |>| 
      │
      ▼
    Cathode

    The cathode is traditionally marked by a line on the physical diode package.

    A common mnemonic is:

    Cathode = K

    7. Forward Bias

    Connect the diode so that the P side is at a higher potential than the N side.

    Conceptually:

    + ─── Anode |>| Cathode ─── −

    This is called:

    Forward Bias

    The applied voltage reduces the effective barrier and allows substantial current to flow once the device reaches its conducting region.


    8. Reverse Bias

    Reverse the polarity:

    − ─── Anode |>| Cathode ─── +

    This is:

    Reverse Bias

    The depletion region becomes wider and the diode normally carries only a very small leakage current.


    9. Forward vs Reverse Bias

    ConditionTypical behavior
    Forward biasSignificant current can flow
    Reverse biasVery small leakage current
    Reverse breakdownLarge reverse current can occur if properly limited

    So:

    Forward bias
         ↓
    Conducting region
    
    Reverse bias
         ↓
    Blocking region

    10. Important Correction

    A diode is not a perfect one-way valve.

    A real diode:

    • Has a nonzero forward voltage
    • Has leakage current
    • Has temperature dependence
    • Has finite switching speed
    • Can experience reverse breakdown

    Therefore:

    Real diode ≠ ideal diode

    The ideal diode is a useful simplified model.


    11. Forward Voltage

    For a common silicon diode, significant forward current often occurs around the order of:

    ~0.6–0.7 V

    under typical operating conditions.

    But this is not a fixed universal value.

    The actual voltage depends on:

    Current
    Temperature
    Diode type
    Device construction

    For example, a Schottky diode typically has a lower forward voltage than a conventional silicon PN-junction diode at comparable conditions.


    12. The Diode I–V Curve

    A simplified diode characteristic looks like:

    Current
      ↑
      │             /
      │           /
      │         /
      │_______/
      │
      └────────────────→ Voltage
              Forward

    In reverse bias:

    Current
      ↑
      │
      │
    ──┼───────────────→ Voltage
      │
      │  small leakage

    At sufficiently large reverse voltage, breakdown can occur.


    13. The Diode Equation

    An idealized PN-junction diode can be modeled using the Shockley diode equation:

    I = Iₛ [e^(V/(nVₜ)) − 1]

    where:

    I   = diode current
    Iₛ  = saturation current
    V   = diode voltage
    n   = ideality factor
    Vₜ  = thermal voltage

    You don’t need to calculate this yet.

    The important idea is:

    Forward voltage ↑
            ↓
    Current can increase very rapidly

    14. Why Does a Diode Conduct?

    At the microscopic level, the applied electric field changes the carrier distributions and the potential barrier at the PN junction.

    Forward bias:

    Barrier reduced
          ↓
    Carrier injection
          ↓
    Current increases

    Reverse bias:

    Barrier increased
          ↓
    Majority-carrier transport suppressed
          ↓
    Small leakage current

    15. Rectification

    One of the most important uses of a diode is:

    Rectification

    Converting an alternating waveform into a unidirectional/pulsating output.

    For example:

    AC input
    
       / \      / \
      /   \    /   \
     /     \  /     \
    /       \/       \

    A diode can block one polarity and pass the other.


    16. Half-Wave Rectifier

    A simple circuit:

    AC ───|>|──── Load

    Output:

       / \       / \
      /   \     /   \
    _/     \___/     \___

    Only one half of the waveform is passed.


    17. Full-Wave Rectifier

    A bridge rectifier uses four diodes:

           D1       D2
     AC ──|>|──┬──|<|── AC
              │
              Load
              │
     AC ──|<|──┴──|>|── AC
           D3       D4

    The circuit routes both halves of the AC waveform so that the load receives the same polarity.


    18. Capacitor + Rectifier

    Now connect our previous lesson.

    AC
     ↓
    Rectifier
     ↓
    Pulsating DC
     ↓
    Capacitor
     ↓
    Smoother DC

    This is a fundamental power-supply concept.


    19. Power Supply

    A simplified power supply can look like:

    AC input
       ↓
    Transformer / converter
       ↓
    Rectifier
       ↓
    Capacitor
       ↓
    Regulator
       ↓
    DC output
       ↓
    Electronic circuit

    Your computer, router, server, and networking equipment all depend on power-conversion systems.


    20. Diodes in Computer Hardware

    Diodes are used in many applications:

    Rectification
    Voltage protection
    Signal detection
    Switching
    Clamping
    ESD protection
    Voltage regulation
    Power management

    They are also incorporated into integrated circuits.


    21. Zener Diode

    A Zener diode is designed to operate in reverse breakdown under controlled conditions.

    Conceptually:

    Reverse voltage
          ↓
    Controlled breakdown
          ↓
    Voltage regulation/reference

    This can be useful for voltage regulation and reference circuits.


    22. LED

    An LED is a:

    Light-Emitting Diode

    When appropriately forward biased, it emits light.

    Conceptually:

    Electrical energy
          ↓
    Semiconductor
          ↓
    Electron-hole recombination
          ↓
    Photon emission
          ↓
    Light

    LEDs are used in:

    Displays
    Indicators
    Lighting
    Optical communication

    23. Photodiode

    A photodiode is designed to detect light.

    Light
     ↓
    Photodiode
     ↓
    Electrical signal

    This is important in optical communication.


    24. Fiber-Optic Communication

    This connects directly to web hosting.

    A simplified fiber communication system:

    Computer
       ↓
    Electrical signal
       ↓
    Optical transmitter
       ↓
    Light
       ↓
    Fiber
       ↓
    Photodetector
       ↓
    Electrical signal
       ↓
    Computer

    Photodiodes are commonly used at the receiving side of optical communication systems.

    Therefore:

    Semiconductor physics
          ↓
    Photodiode
          ↓
    Fiber communication
          ↓
    Internet
          ↓
    Web hosting

    25. Diode → Transistor

    This is the most important transition.

    A diode uses a PN junction.

    A transistor uses semiconductor structures to provide much more powerful control of electrical signals.

    PN junction
        ↓
    Diode
        ↓
    Multiple semiconductor regions
        ↓
    Transistor

    A transistor can be used as:

    Switch
    Amplifier
    Signal-control element

    26. From Transistor to CPU

    Now our complete chain becomes:

    Silicon
     ↓
    Doping
     ↓
    P-type / N-type
     ↓
    PN junction
     ↓
    Diode
     ↓
    Transistor
     ↓
    Logic gate
     ↓
    Digital circuit
     ↓
    CPU
     ↓
    Computer

    Then:

    Computer
     ↓
    Operating System
     ↓
    Network Interface
     ↓
    Networking
     ↓
    Internet
     ↓
    Web Server
     ↓
    Web Hosting

    27. Quick Check

    What is a diode?

    A semiconductor device with strongly asymmetric current-voltage behavior.

    What are its two terminals?

    Anode
    Cathode

    What is forward bias?

    Applying polarity that reduces the PN-junction barrier and allows substantial current.

    What is reverse bias?

    Applying the opposite polarity, normally producing only small leakage current until breakdown.

    What is rectification?

    Converting an alternating waveform into a unidirectional/pulsating output.

    What is an LED?

    A light-emitting diode.

    What is a photodiode?

    A semiconductor device designed to detect light.


    Next Lesson

    Lesson 011 — What Is a Transistor?

    This is one of the most important lessons in the entire course.

    We will go from:

    Semiconductor
          ↓
    P-type
          ↓
    N-type
          ↓
    PN junction
          ↓
    Transistor
          ↓
    Switch
          ↓
    0 and 1
          ↓
    Logic gates
          ↓
    Computer

    Then we will begin understanding how billions of transistors can become a CPU, which eventually brings us all the way to the server running your WordPress and web-hosting infrastructure.

  • CresignSys Learn — Lesson 009

    Course: From Basic Science to Web Hosting

    Module 01 — Basic Science → Electronics

    What Is a Semiconductor?

    Difficulty: Beginner
    Prerequisites: Lesson 008 — What Is Inductance?
    Estimated time: 25 minutes


    1. Learning Objectives

    After this lesson, you should understand:

    • What a semiconductor is
    • How conductors, insulators, and semiconductors differ
    • Why silicon is important
    • What valence electrons are
    • What a crystal lattice is
    • What energy bands mean
    • What a band gap is
    • What doping means
    • What P-type and N-type semiconductor materials are
    • Why semiconductors are the foundation of computer chips

    2. The Big Transition

    So far, we studied:

    Matter
     ↓
    Atoms
     ↓
    Electrons
     ↓
    Electric charge
     ↓
    Electric field
     ↓
    Voltage
     ↓
    Current
     ↓
    Circuits
     ↓
    Resistance
     ↓
    Capacitance
     ↓
    Inductance

    Now we ask:

    How can we control electricity to build electronic devices?

    The answer begins with semiconductors.


    3. Three Important Material Categories

    Materials can be broadly classified according to their electrical behavior:

    Materials
       │
       ├── Conductors
       │
       ├── Semiconductors
       │
       └── Insulators

    4. Conductors

    A conductor allows electric charge to move relatively easily.

    Example:

    Copper

    Simplified:

    Electric field
          ↓
    Mobile charge carriers
          ↓
    Current

    Other examples include:

    Aluminum
    Silver
    Gold

    5. Insulators

    An insulator strongly restricts electrical conduction.

    Examples:

    Glass
    Plastic
    Rubber
    Ceramic

    Simplified:

    Electric field
          ↓
    Very limited charge transport

    Insulators are useful because they can prevent unwanted current flow.


    6. Semiconductors

    A semiconductor has electrical properties between those of typical conductors and insulators, but the important feature is that its conductivity can be controlled.

    A simple comparison:

    Conductor
       ↓
    High conductivity
    
    Semiconductor
       ↓
    Controllable conductivity
    
    Insulator
       ↓
    Very low conductivity

    Common semiconductor materials include:

    Silicon
    Germanium
    Gallium arsenide

    For modern mainstream computing, silicon is especially important.


    7. Why Silicon?

    Silicon has atomic number:

    14

    Therefore a neutral silicon atom contains:

    14 protons
    14 electrons

    Its electrons occupy different energy states.

    For our purposes, the outermost electrons are particularly important.


    8. What Are Valence Electrons?

    The electrons involved in an atom’s outermost occupied shell are commonly called valence electrons.

    Silicon has:

    4 valence electrons

    This is important because silicon atoms can form strong covalent bonds with neighboring silicon atoms.


    9. Silicon Crystal

    In solid silicon, atoms arrange themselves in an organized crystal structure.

    Conceptually:

    Si ─ Si ─ Si
    │    │    │
    Si ─ Si ─ Si
    │    │    │
    Si ─ Si ─ Si

    The actual three-dimensional structure is more complex.

    The atoms share electrons through covalent bonding.


    10. Why Bonding Matters

    In an isolated atom, electrons occupy atomic energy states.

    When enormous numbers of atoms form a solid:

    Atoms
     ↓
    Interact
     ↓
    Allowed electronic states broaden
     ↓
    Energy bands

    This leads to the concept of:

    Energy Bands


    11. What Is an Energy Band?

    In a solid, electrons can occupy ranges of allowed energy rather than just the isolated-atom energy levels.

    Two important bands are:

    Conduction band
    ────────────────
    
    Band gap
    ───────────────
    
    Valence band
    ────────────────

    The exact band structure depends on the material.


    12. Valence Band

    The valence band is associated with electrons involved in bonding and occupied electronic states.

    For basic semiconductor physics:

    Valence band
          ↓
    Electrons primarily associated with bonding states

    13. Conduction Band

    The conduction band contains electronic states in which electrons can contribute significantly to electrical conduction.

    Conceptually:

    Conduction band
          ↓
    Mobile conduction electrons

    14. Band Gap

    Between the valence and conduction bands there can be an energy range where allowed electronic states are absent.

    This is the:

    Band Gap

    Conduction band
    ══════════════════
    
         BAND GAP
    
    ══════════════════
    Valence band

    The size of the band gap strongly affects the electrical properties of the material.


    15. Conductor vs Semiconductor vs Insulator

    A simplified picture:

    Conductor

    Valence/conduction states
    overlap or are readily available

    Therefore conduction is relatively easy.

    Semiconductor

    Valence band
    ────────────
    
    Small/moderate band gap
    
    ────────────
    Conduction band

    Electrical behavior can be controlled.

    Insulator

    Valence band
    ────────────
    
    Large band gap
    
    ────────────
    
    Conduction band

    Much less thermal excitation occurs under ordinary conditions.


    16. Temperature Matters

    At absolute zero in an idealized semiconductor, very few electrons have enough thermal energy to cross the band gap.

    As temperature increases:

    Temperature ↑
          ↓
    More thermal energy
          ↓
    More carriers can be excited
          ↓
    Conductivity can increase

    This is one reason semiconductor behavior differs from metals.


    17. Light Can Also Matter

    Electrons can gain energy from photons.

    In suitable semiconductor materials:

    Photon energy
          ↓
    Electron excitation
          ↓
    Electron-hole pair

    This principle is used in devices such as:

    Solar cells
    Photodiodes
    Image sensors
    LEDs

    18. What Is Doping?

    Pure semiconductor material is called intrinsic semiconductor.

    We can deliberately introduce very small concentrations of specific impurity atoms to change the semiconductor’s electrical properties.

    This process is called:

    Doping

    Pure silicon
         ↓
    Add controlled impurity atoms
         ↓
    Doped silicon

    This is one of the most important technologies in semiconductor manufacturing.


    19. N-Type Semiconductor

    Suppose silicon is doped with a suitable Group 15 donor impurity, such as phosphorus.

    Phosphorus has five valence electrons.

    Silicon has four.

    The extra electron can contribute to conduction.

    Conceptually:

    Phosphorus
         ↓
    Donor
         ↓
    Additional conduction electron
         ↓
    N-type semiconductor

    The major mobile carriers are electrons.


    20. P-Type Semiconductor

    Now use a suitable Group 13 acceptor impurity, such as boron.

    Boron has three valence electrons.

    Silicon has four.

    This creates an electron deficiency in the bonding structure, described as a hole.

    Conceptually:

    Boron
       ↓
    Acceptor
       ↓
    Hole
       ↓
    P-type semiconductor

    The major mobile carriers are holes.


    21. What Is a Hole?

    A hole is not a physical particle like an electron.

    It is a useful model describing the absence of an electron in an otherwise occupied electronic state.

    When nearby electrons move to fill that vacancy:

    Electron movement
          ↓
    Hole appears to move

    So:

    Electron = actual elementary particle
    
    Hole = effective carrier describing missing electron

    22. P-Type vs N-Type

    PropertyP-TypeN-Type
    Dopant typeAcceptorDonor
    Majority carrierHolesElectrons
    Example dopantBoronPhosphorus
    Silicon remainsSemiconductorSemiconductor

    Important:

    P-type does not mean the entire material has a positive electric charge.

    N-type does not mean the entire material has a negative electric charge.

    The material can remain electrically neutral overall.


    23. Joining P-Type and N-Type

    Now something very important happens.

    Suppose we put:

    P-type
       │
       │
    N-type

    together.

    We have created a:

    PN Junction

    This is the foundation of the semiconductor diode.


    24. What Happens at the Junction?

    Near the boundary, electrons and holes interact and recombine.

    This produces a region depleted of mobile carriers called the:

    Depletion Region

    Simplified:

    P-type     Depletion      N-type
    ███████   ░░░░░░░░░░    ███████

    An internal electric field develops across this region.

    This creates a potential barrier that influences carrier movement.


    25. PN Junction → Diode

    A PN junction can be engineered into a diode.

    A diode is a semiconductor device that strongly favors current in one direction under appropriate operating conditions.

    Conceptually:

    PN Junction
         ↓
    Diode
         ↓
    Controlled current behavior

    We will study this in detail next.


    26. Diode → Transistor

    Semiconductor structures can become much more sophisticated.

    PN Junction
         ↓
    Diode
         ↓
    Multiple semiconductor regions
         ↓
    Transistor

    A transistor can control current or voltage and can act as a switch or amplifier.


    27. Transistor → Computer

    Now the major chain appears:

    Silicon
     ↓
    Doping
     ↓
    P-type / N-type
     ↓
    PN junction
     ↓
    Diode
     ↓
    Transistor
     ↓
    Logic gate
     ↓
    Digital circuit
     ↓
    Processor
     ↓
    Computer

    And finally:

    Computer
     ↓
    Operating system
     ↓
    Networking
     ↓
    Internet
     ↓
    Web server
     ↓
    Website
     ↓
    Web hosting

    28. Why This Lesson Is Important

    This is the major transition in our course.

    Before Lesson 009:

    Basic physics
          ↓
    Electrical circuits

    After Lesson 009:

    Semiconductor physics
          ↓
    Electronic devices
          ↓
    Computer hardware

    You are now entering the technology that makes modern computers possible.


    29. Quick Check

    What is a semiconductor?

    A material whose electrical behavior can be controlled and whose properties lie between those of typical conductors and insulators in the relevant physical sense.

    What is silicon?

    A semiconductor material widely used to manufacture electronic devices and integrated circuits.

    What is doping?

    Introducing controlled impurity atoms into a semiconductor to modify its electrical properties.

    What is N-type?

    A semiconductor whose majority mobile carriers are electrons.

    What is P-type?

    A semiconductor whose majority mobile carriers are holes.

    What is a PN junction?

    A junction between P-type and N-type semiconductor regions.

    What comes after the PN junction?

    PN Junction
        ↓
    Diode

    Next Lesson

    Lesson 010 — What Is a Diode?

    We will go deeper into:

    P-type
       +
    N-type
       ↓
    PN junction
       ↓
    Depletion region
       ↓
    Built-in electric field
       ↓
    Forward bias
       ↓
    Reverse bias
       ↓
    Diode current
       ↓
    Rectification
       ↓
    Power supplies

    Then we will reach the most important component in the entire journey:

    the transistor → logic gates → CPU → computer → server → web hosting.

  • CresignSys Learn — Lesson 008

    Course: From Basic Science to Web Hosting

    Module 01 — Basic Science

    What Is Inductance?

    Difficulty: Beginner
    Prerequisites: Lesson 007 — What Is Capacitance?
    Estimated time: 20 minutes


    1. Learning Objectives

    After this lesson, you should understand:

    • What inductance is
    • What an inductor is
    • The relationship between current and magnetic fields
    • How an inductor stores energy
    • Why an inductor opposes changes in current
    • The difference between resistance, capacitance, and inductance
    • Why inductors are important in power supplies and electronics

    2. Start With Current

    We learned:

    Voltage
       ↓
    Electric field
       ↓
    Charge carriers respond
       ↓
    Current

    Now ask:

    What happens around a wire when current flows?

    A current produces a magnetic field.

    Conceptually:

    Electric current
          ↓
    Magnetic field

    This is the foundation of inductance.


    3. What Is a Magnetic Field?

    A magnetic field describes the magnetic influence in a region of space.

    Around a straight current-carrying wire:

            ↺
         ↺  │  ↻
       ↺    │    ↻
            │
            │
          Current

    The magnetic field forms circular patterns around the conductor.

    The direction can be determined using the right-hand rule.


    4. What Is an Inductor?

    An inductor is an electrical component designed to store energy in a magnetic field.

    A simple inductor is often made from a coil of wire:

           ┌─────────┐
    ───────(((((((((──────
           └─────────┘

    When current flows through the coil:

    Current
       ↓
    Magnetic field
       ↓
    Stored magnetic energy

    5. What Is Inductance?

    Inductance describes how strongly a circuit element opposes changes in current.

    The symbol is:

    L

    The unit is:

    Henry (H)

    For an ideal inductor:

    V = L(di/dt)

    where:

    V = voltage
    L = inductance
    di/dt = rate of change of current

    6. The Most Important Idea

    An inductor does not simply oppose current.

    It opposes changes in current.

    This distinction is very important.

    Current constant
          ↓
    Ideal inductor voltage = 0

    but:

    Current changing rapidly
          ↓
    Large induced voltage

    7. Why Does This Happen?

    When current through a conductor changes:

    Changing current
          ↓
    Changing magnetic field
          ↓
    Induced voltage

    This behavior is described by Faraday’s law of electromagnetic induction.

    The induced effect acts in a direction that opposes the change producing it, consistent with Lenz’s law.


    8. Example

    Suppose an inductor has:

    L = 1 H

    and the current changes at:

    di/dt = 2 A/s

    Then:

    V = L(di/dt)
    
    V = 1 × 2
    
    V = 2 V

    The idealized induced voltage magnitude is:

    2 V

    The actual polarity depends on the direction of the current change.


    9. Inductor Energy

    An ideal inductor stores energy in its magnetic field.

    The equation is:

    E = ½LI²

    where:

    E = energy
    L = inductance
    I = current

    Notice the similarity to a capacitor:

    Capacitor:
    
    E = ½CV²
    
    Inductor:
    
    E = ½LI²

    10. Capacitor vs Inductor

    This is one of the most useful comparisons in basic electronics.

    ComponentStores energy inOpposes
    ResistorDoes not ideally store energyCurrent/voltage relationship through dissipation
    CapacitorElectric fieldChange in voltage
    InductorMagnetic fieldChange in current

    Simplified:

    Resistor
       ↓
    Dissipation
    
    Capacitor
       ↓
    Electric field
    
    Inductor
       ↓
    Magnetic field

    11. What Happens When Current Starts?

    Suppose an inductor is initially carrying zero current.

    You suddenly apply a voltage.

    The inductor doesn’t allow its current to jump instantaneously in the idealized model.

    Instead:

    Voltage applied
          ↓
    Current begins increasing
          ↓
    Magnetic field builds
          ↓
    Energy stored

    The current changes progressively according to the circuit.


    12. What Happens When Power Is Removed?

    Suppose current is flowing through an inductor.

    Now disconnect the source.

    The magnetic field begins collapsing.

    Stored magnetic energy
           ↓
    Collapsing magnetic field
           ↓
    Induced voltage
           ↓
    Energy released into circuit

    This can create a large voltage spike if the current has no safe path to continue.


    13. Why Relays and Motors Matter

    Inductive loads include:

    Motors
    Relays
    Transformers
    Solenoids
    Coils

    When current through these devices changes suddenly, the resulting induced voltage can be significant.

    This is why circuits controlling relay coils often include protective components such as a flyback diode.

    We will study this later.


    14. Inductor in a DC Circuit

    Consider:

    Battery ── R ── L

    When the circuit is switched on:

    Current starts
         ↓
    Inductor resists rapid increase
         ↓
    Current gradually approaches its steady value

    For a simple RL circuit:

    τ = L/R

    This is the RL time constant.


    15. Compare RC and RL

    We now have:

    RC circuit

    τ = RC

    RL circuit

    τ = L/R

    Both introduce time-dependent behavior.

    R + C
     ↓
    Electric-field storage
    
    R + L
     ↓
    Magnetic-field storage

    16. Why Are Inductors Used?

    Inductors are used in:

    Power supplies
    Filters
    Transformers
    Radio circuits
    Oscillators
    DC-DC converters
    Motors
    EMI filtering

    17. Inductors in Power Supplies

    A simplified switching power supply may contain:

    Input
      ↓
    Switching circuit
      ↓
    Inductor
      ↓
    Capacitor
      ↓
    Regulated output

    The inductor and capacitor work together to store and transfer energy and reduce unwanted voltage/current variation.

    This is extremely important in computers and servers.


    18. Inductor + Capacitor

    Now we have two energy-storage components:

    Capacitor
       ↓
    Electric field
    
    Inductor
       ↓
    Magnetic field

    When combined:

    L + C
     ↓
    Resonance
     ↓
    Filters
     ↓
    Oscillators
     ↓
    Communication circuits

    This becomes important later when we study networking and radio signals.


    19. Resonance

    An LC circuit can exchange energy between:

    Electric field
          ↕
    Magnetic field

    Conceptually:

    Capacitor
       ↓
    Electric energy
       ↓
    Inductor
       ↓
    Magnetic energy
       ↓
    Capacitor
       ↓
    ...

    This exchange can produce oscillatory behavior.


    20. Why This Matters for Communication

    Communication systems use electrical and electromagnetic signals.

    Those signals often require:

    Filtering
    Frequency selection
    Oscillation
    Impedance matching
    Signal conditioning

    Inductors and capacitors are important components in these functions.

    This eventually connects to:

    Electronic communication
     ↓
    Networking
     ↓
    Internet

    21. The Three Basic Passive Components

    You now know the three fundamental passive circuit elements:

              CIRCUITS
                 │
         ┌───────┼───────┐
         ↓       ↓       ↓
     Resistor Capacitor Inductor
         │       │       │
         ↓       ↓       ↓
    Dissipation Electric  Magnetic
               field      field
                 │         │
                 └────┬────┘
                      ↓
                  Electronics

    22. Their Basic Equations

    Resistor

    V = IR

    Capacitor

    i = C(dV/dt)

    Inductor

    V = L(di/dt)

    These three equations form a major foundation for circuit analysis.


    23. A Deeper Connection

    Notice the pattern:

    Resistor:
    Voltage ↔ Current
    
    Capacitor:
    Current ↔ Change in Voltage
    
    Inductor:
    Voltage ↔ Change in Current

    This tells us that circuits are not merely about “electricity flowing.”

    They are systems in which:

    Voltage
    Current
    Electric field
    Magnetic field
    Energy
    Time

    interact with one another.


    24. From Basic Electricity to Electronics

    Our learning path is now:

    Matter
     ↓
    Atom
     ↓
    Electron
     ↓
    Charge
     ↓
    Electric field
     ↓
    Voltage
     ↓
    Current
     ↓
    Circuit
     ↓
    Resistance
     ↓
    Capacitance
     ↓
    Inductance
     ↓
    RLC circuits
     ↓
    Signals
     ↓
    Electronics

    The next step is where things become much more directly connected to computers:

    Materials
     ↓
    Conductors
     ↓
    Insulators
     ↓
    Semiconductors

    25. Quick Check

    What does an inductor store?

    Energy in a magnetic field.

    What does inductance oppose?

    Changes in current.

    Unit of inductance?

    Henry (H).

    Energy stored?

    E = ½LI²

    Voltage-current relationship?

    V = L(di/dt)

    RC time constant?

    τ = RC

    RL time constant?

    τ = L/R

    Next Lesson

    Lesson 009 — What Is a Semiconductor?

    This is a major transition.

    We will study:

    Conductors
          ↓
    Insulators
          ↓
    Semiconductors
          ↓
    Silicon
          ↓
    Crystal structure
          ↓
    Valence electrons
          ↓
    Energy bands
          ↓
    Band gap
          ↓
    Doping
          ↓
    P-type
          ↓
    N-type
          ↓
    Diode
          ↓
    Transistor
          ↓
    Computer chip

    This is the point where our basic science course starts becoming semiconductor and computer engineering.

  • CresignSys Learn — Lesson 007

    Course: From Basic Science to Web Hosting

    Module 01 — Basic Science

    What Is Capacitance?

    Difficulty: Beginner
    Prerequisites: Lesson 006 — What Is Resistance?
    Estimated time: 20 minutes


    1. Learning Objectives

    After this lesson, you should understand:

    • What capacitance is
    • What a capacitor is
    • How a capacitor stores energy
    • The relationship between charge and voltage
    • How a capacitor charges and discharges
    • What affects capacitance
    • Why capacitors are used in electronics
    • Why capacitance matters in computers and servers

    2. Start With Electric Charge

    We previously learned:

    Electric charge
          ↓
    Electric field
          ↓
    Electric potential
          ↓
    Voltage

    Now ask:

    Can we deliberately store electrical energy using an electric field?

    Yes.

    This is the basic idea behind a capacitor.


    3. What Is a Capacitor?

    A capacitor is an electrical component designed to store energy in an electric field.

    A simple capacitor consists of two conductors separated by an insulating material.

    Conceptually:

            Capacitor
    
          +++++++++++++
          +  Plate 1  +
          +++++++++++++
               │
           Insulator
               │
          -------------
          -  Plate 2  -
          -------------

    The two conductive plates do not normally touch each other.


    4. What Happens When We Connect a Battery?

    Consider:

    Battery
      │
      ├──── Capacitor ────┐
      │                   │
      └───────────────────┘

    When connected, the battery causes charge separation on the capacitor plates.

    Simplified:

    Plate 1
    ++++++++++++
    
    Plate 2
    ------------

    This creates an electric field between the plates.


    5. The Important Idea

    A capacitor doesn’t simply “store electrons.”

    More accurately:

    A capacitor stores electrical energy in the electric field associated with separated charge.

    The chain is:

    Charge separation
          ↓
    Electric field
          ↓
    Stored electrical energy

    6. What Is Capacitance?

    Capacitance describes how much charge a capacitor stores for a given voltage.

    The basic equation is:

    C = Q/V

    Therefore:

    Q = CV

    where:

    C = capacitance
    Q = charge
    V = voltage

    The unit of capacitance is the:

    Farad (F)

    7. Example

    Suppose:

    C = 1 F
    V = 5 V

    Then:

    Q = CV
    
    Q = 1 × 5
    
    Q = 5 C

    So the idealized capacitor stores 5 coulombs of charge separation at 5 V.


    8. One Farad Is Large

    A farad is a relatively large unit for many ordinary electronic circuits.

    Common values include:

    Microfarad     μF
    Nanofarad      nF
    Picofarad      pF

    The relationships are:

    1 μF = 10⁻⁶ F
    
    1 nF = 10⁻⁹ F
    
    1 pF = 10⁻¹² F

    9. What Determines Capacitance?

    For a simple parallel-plate capacitor:

    C = εA/d

    where:

    C = capacitance
    ε = permittivity of the material
    A = plate area
    d = separation between plates

    Therefore:

    Larger plate area
          ↓
    Higher capacitance

    and:

    Smaller separation
          ↓
    Higher capacitance

    The dielectric material between the plates also affects capacitance.


    10. Dielectric

    The insulating material between capacitor plates is called the dielectric.

    Examples include:

    Ceramic
    Plastic
    Glass
    Oxide layers

    The dielectric changes the electric-field behavior between the plates and can increase capacitance compared with vacuum.


    11. Capacitor Charging

    Imagine an initially uncharged capacitor.

    Time = 0
    
    + plate: 0
    - plate: 0

    Connect a voltage source.

    Initially, charge begins accumulating on the plates.

    Start
     ↓
    Charge separation increases
     ↓
    Voltage across capacitor increases
     ↓
    Eventually approaches source voltage

    For a simple resistor-capacitor circuit:

    Battery ── R ── C

    the charging is not instantaneous.


    12. Why Doesn’t It Charge Instantly?

    The resistor limits current.

    So:

    Resistance
         +
    Capacitance
         ↓
    Charging takes time

    This leads to an important concept:

    Time Constant

    For a simple RC circuit:

    τ = RC

    where:

    τ = time constant
    R = resistance
    C = capacitance

    13. Example

    Suppose:

    R = 1 kΩ
    C = 100 μF

    Then:

    τ = RC

    Convert:

    R = 1000 Ω
    C = 100 × 10⁻⁶ F

    Therefore:

    τ = 1000 × 100 × 10⁻⁶
    τ = 0.1 s

    So the time constant is:

    100 ms

    14. What Does One Time Constant Mean?

    For a simple charging capacitor, after approximately one time constant:

    ~63%

    of the final voltage has been reached.

    After approximately:

    1τ → 63%
    2τ → 86%
    3τ → 95%
    4τ → 98%
    5τ → 99%+

    So after roughly five time constants, the capacitor is very close to its final voltage.


    15. Capacitor Discharging

    Now imagine a charged capacitor connected through a resistor.

    Capacitor
        ↓
    Resistor
        ↓
    Discharge

    The stored energy is released through the circuit.

    The voltage decreases exponentially:

    High voltage
         │\
         │ \
         │  \
         │   \
         │    \____
         └──────────── Time

    Again, the time constant is:

    τ = RC

    16. Capacitor Energy

    The energy stored in an ideal capacitor is:

    E = ½CV²

    where:

    E = energy in joules
    C = capacitance
    V = voltage

    Notice that energy depends on voltage squared.

    So increasing voltage can significantly increase stored energy.


    17. Example

    Suppose:

    C = 1000 μF
    V = 10 V

    Convert:

    C = 0.001 F

    Then:

    E = ½CV²
    
    E = ½ × 0.001 × 10²
    
    E = 0.05 J

    The capacitor stores approximately:

    0.05 joule

    in the idealized case.


    18. Does Current Flow Through a Capacitor?

    This is an important question.

    In a simple DC steady-state circuit, an ideal capacitor eventually behaves like an open circuit.

    But during charging or discharging, current flows in the external circuit.

    For a capacitor:

    i = C(dV/dt)

    Therefore:

    Voltage changing rapidly
           ↓
    Larger capacitor current

    and:

    Voltage constant
           ↓
    Ideal capacitor current = 0

    for steady-state DC.


    19. Capacitor and DC

    Suppose we connect a capacitor to a DC battery.

    Initially:

    Current flows

    As the capacitor charges:

    Current decreases

    Eventually:

    Current → 0

    for an ideal capacitor under steady DC conditions.

    So:

    DC
     ↓
    Capacitor
     ↓
    Transient current
     ↓
    Steady state → no ideal current

    20. Capacitor and Changing Signals

    Capacitors behave differently when voltage is continuously changing.

    This makes them useful in:

    Filters
    Signal coupling
    Timing circuits
    Oscillators
    Power supplies
    Noise suppression
    Memory circuits

    21. Capacitors in Power Supplies

    Electronic devices need stable power.

    A simplified power supply might contain:

    AC
     ↓
    Rectifier
     ↓
    Pulsating DC
     ↓
    Capacitor
     ↓
    Smoother DC
     ↓
    Regulator
     ↓
    Electronic circuit

    The capacitor helps reduce voltage fluctuations.


    22. Capacitors in Computers

    Computers contain enormous numbers of capacitive effects.

    Capacitance exists in:

    Transistors
    Interconnects
    Circuit nodes
    Memory cells
    Input/output structures

    These capacitances affect how quickly electronic signals can change.

    For example:

    Transistor switches
           ↓
    Capacitive load must charge/discharge
           ↓
    Signal transition takes time
           ↓
    Limits switching speed

    This is one reason capacitance matters to CPU performance.


    23. Capacitors and Digital Signals

    A digital signal may look like:

    High ────────┐      ┌────────
                 │      │
                 │      │
    Low          └──────┘

    But a real signal cannot change infinitely fast.

    Because of circuit resistance and capacitance:

    Ideal:
    
          ┌──────
          │
    ──────┘
    
    Real:
    
          /──────
         /
    ─────

    The transition has a finite rise/fall time.


    24. Resistance + Capacitance

    We now have two important electrical properties:

    Resistance
        ↓
    Opposes current / dissipates energy
    
    Capacitance
        ↓
    Stores energy in an electric field

    Together:

    R + C
     ↓
    RC circuit
     ↓
    Timing
    Filtering
    Signal shaping

    25. From Capacitor to Computer

    Our technology chain is becoming deeper:

    Matter
     ↓
    Atoms
     ↓
    Electrons
     ↓
    Charge
     ↓
    Electric field
     ↓
    Voltage
     ↓
    Current
     ↓
    Circuit
     ↓
    Resistance
     ↓
    Capacitance
     ↓
    Electronic circuits
     ↓
    Semiconductors
     ↓
    Transistors
     ↓
    Digital electronics
     ↓
    Computer

    Eventually:

    Computer
     ↓
    Operating System
     ↓
    Networking
     ↓
    Internet
     ↓
    Web Server
     ↓
    Web Hosting

    26. Quick Check

    What does a capacitor store?

    Electrical energy in an electric field.

    What is capacitance?

    The charge stored per unit voltage:

    C = Q/V

    Unit?

    Farad (F).

    What is the energy stored?

    E = ½CV²

    What is the RC time constant?

    τ = RC

    What happens to an ideal capacitor under steady DC?

    After charging, it behaves as an open circuit.


    Next Lesson

    Lesson 008 — What Is Inductance?

    We will add the third major passive electrical property:

    Resistance
         ↓
    Dissipates energy
    
    Capacitance
         ↓
    Electric-field energy
    
    Inductance
         ↓
    Magnetic-field energy

    Then we can understand:

    R
    C
    L
     ↓
    AC/DC circuits
     ↓
    Filters
     ↓
    Power supplies
     ↓
    Signals
     ↓
    Electronics

    After that, we will begin the transition from basic electrical science → electronic components → semiconductors → diode → transistor.