Architecture of CPU, RAM & Storage | Hardware & System

Dekhin Application
0

Architecture : CPU

1.1   # Statement and Core knowledge of CPU

A Central Processing Unit (CPU)—often called the "brain" of a computer—is the primary electronic circuit responsible for executing instructions, performing arithmetic & logical calculations and coordinating data flow across the entire system.

# Core Functions of a CPU

The CPU operates on a continuous, high-speed cycle known as the Instruction Cycle (Fetch-Decode-Execute Cycle):
  • Fetch : Retrieves instructions from the computer's memory (RAM or L1 cache).
  • Decode : Translates the retrieved instruction into micro-operations that the hardware understands.
  • Execute : Performs the requested operation (such as addition, data movement, or logical evaluation).
  • Write-Back : Stores the final output or calculation back into registers or system memory.

# Essential Components

A modern CPU contains several specialized internal units:
  • Control Unit (CU) : Directs the operations of the processor by decoding instructions and routing control signals to other components.
  • Arithmetic Logic Unit (ALU) : Performs all mathematical calculations (addition, subtraction) and logical comparisons (AND, OR, NOT).
  • Registers : Small, ultra-fast internal memory locations used to hold data currently being processed.
  • Cache Memory (L1, L2, L3) : High-speed, on-die memory layers that store frequently accessed data to minimize waiting on slower main memory (RAM).

# Modern CPU Features

  • Multi-Core Architecture : Modern CPUs combine multiple independent processing units (cores) on a single silicon chip to execute multiple.
  • Clock Speed : Measured in Gigahertz (GHz), clock speed determines how many instruction cycles a CPU core can perform per second.
  • Instruction Sets : Architectures like x86-64 (common in desktops/servers) and ARM64 (common in mobile devices/laptops) define the specific assembly instructions a CPU can natively process.

# Modern CPU Features

CPUs can be classified across several categories based on architecture like core count, use case/device type and instruction set.
1. By Core Count Architecture
  • Single-Core CPU : Contains a single physical processing unit. Processes one task at a time sequentially. (Common in legacy systems and basic microcontrollers).
  • Dual-Core CPU : Features two physical processing cores on a single chip, allowing basic multitasking and split workload execution.
  • Quad-Core CPU : Contains four physical cores, handling demanding software, moderate gaming, and multitasking efficiently.
  • Hexa-Core / Octa-Core CPUs : Features 6 or 8 physical cores, standard in modern high-performance desktop computers, laptops and smartphones.
  • Multi-Core / High-Core Count CPUs : Contains 12, 16, 24, 32, or up to 128+ cores, designed for workstation computing, 3D rendering, virtualized environments, and enterprise servers.

2. By Instruction Set Architecture (ISA)
  • x86 / x86-64 Processors : Complex Instruction Set Computer (CISC) architecture dominant in desktop PCs, laptops, and traditional enterprise servers (e.g., Intel Core/Xeon, AMD Ryzen/EPYC).
  • ARM Processors : Reduced Instruction Set Computer (RISC) architecture focused on power efficiency and performance-per-watt. Standard in mobile devices, IoT, tablets, modern MacBooks (Apple Silicon), and cloud server instances.
  • RISC-V Processors : An open-source RISC instruction set architecture increasingly used in custom silicon, embedded systems, automotive applications, and AI accelerators.
  • MIPS & PowerPC : Legacy or specialized RISC architectures used in networking hardware (routers/switches), embedded controllers, and specialized computing.

3. By Device Type & Application
  • Desktop CPUs :High-power processors designed for personal desktop computers, prioritizing raw single-threaded and multi-threaded performance (e.g., Intel Core i5/i7/i9, AMD Ryzen 5/7/9).
  • Mobile / Laptop CPUs : Power-optimized processors designed to balance performance, thermal output and battery life in laptops (e.g., Intel Core Ultra, AMD Ryzen U/HS-series, Apple M-series).
  • Smartphone & Mobile SoCs : System-on-Chip designs combining the CPU, GPU, NPU and modem onto a single die for smartphones and wearables (e.g., Qualcomm Snapdragon, MediaTek Dimensity, Apple A-series).
  • Server & Enterprise CPUs : High-reliability, high-core-count processors supporting multi-channel ECC memory, extensive PCIe lanes and hardware virtualization (e.g., Intel Xeon, AMD EPYC).
  • Embedded CPUs / Microcontrollers (MCUs) : Low-power processors designed to control specific hardware functions in automotive systems, medical equipment, home appliances and IoT devices.

4. By Internal Design / Microarchitecture
  • Homogeneous CPUs : Every core inside the processor package uses the exact same microarchitecture, size and clock speed layout.
  • Heterogeneous (Hybrid) CPUs : Combines different core types on the same die—typically high-performance cores (P-cores) for demanding front-end tasks and energy-efficient cores (E-cores) for background operations (e.g., Intel Hybrid architecture, ARM big.LITTLE / DynamIQ).

# Core Execution Concepts & Pipeline Mechanics

At the heart of processing speed is instruction execution efficiency:
\[ \text{CPU Performance} = \frac{\text{Instructions}}{\text{Program}} \times \frac{\text{Clock Cycles}}{\text{Instruction (CPI)}} \times \frac{\text{Seconds}}{\text{Clock Cycle}} \]

To maximize throughput, modern CPUs employ several complex microarchitectural techniques:
  • Instruction Pipelining : Breaking instruction execution into distinct sequential stages (Fetch, Decode, Execute, Memory, Write-Back) so multiple instructions can be processed simultaneously at different stages.
  • Superscalar Execution & Out-of-Order (OoO) Processing : The CPU uses a Reorder Buffer (ROB) and Reservation Stations to analyze incoming streams of micro-operations ($\mu\text{ops}$) and execute independent instructions out of original program order to prevent stall time.
  • Branch Prediction & Speculative Execution : Modern CPUs guess which path conditional statements (if-else) will take using hardware branch predictors (such as TAGE or perceptron-based predictors). The CPU speculatively executes instructions down the predicted path; if incorrect, it flushes the pipeline.
  • Vectorization & SIMD : Single Instruction, Multiple Data extensions (e.g., AVX-512, ARM NEON) allow a single instruction to operate on vectors of parallel data simultaneously.

1.2   # Statement and Core knowledge of RAM

RAM (Random Access Memory) is a computer's short-term physical memory that temporarily stores data and instruction code the CPU needs to access quickly while performing active tasks. Unlike long-term storage (such as an SSD or HDD), RAM is volatile memory, meaning all stored data is cleared instantly when the computer is powered off.

# Key Characteristics of RAM

  • High-Speed Performance : RAM provides read and write speeds drastically faster than solid-state drives or hard drives, allowing the CPU to retrieve data with minimal latency.
  • Random Access : The CPU can access any memory address directly and instantly, regardless of where the data is stored in the memory array.
  • Temporary / Volatile : Data is only maintained while the module receives electrical power.

# Core Functions of RAM

  • Active Application Storage : Holds open programs, browser tabs, OS processes and active files currently in use.
  • Buffer for the CPU : Provides a fast staging ground so the processor does not freeze or slow down waiting for slower main storage drives.
  • Multitasking Support : Greater RAM capacity allows the system to run more applications simultaneously without swapping data to disk.

# Memory Hierarchy & Cache Coherency

Because CPU computation is vastly faster than DRAM main memory retrieval, performance relies heavily on minimizing latency through a multi-tiered memory sub-system:
  • Registers : Ultra-fast, single-cycle access inside the CPU core.
  • L1 Cache (Instruction & Data) : Extremely low latency (3–5 cycles), smallest capacity (typically 32KB–64KB per core).
  • L2 Cache : Low latency (10–14 cycles), dedicated per core or shared among small clusters (512KB–3MB per core).
  • L3 Cache (LLC - Last Level Cache) : Higher latency (30–50 cycles), shared across all cores (up to tens or hundreds of megabytes).
  • Main Memory (RAM) : High capacity, high latency (100–200+ cycles).
  • # Types of RAM

    RAM can be categorized primarily by technological architecture (Dynamic vs. Static) and module design / form factor.
    1. Primary Hardware Technologies
    • DRAM (Dynamic RAM) : Uses a transistor and capacitor pair for each bit of data. Capacitors lose charge over time, so DRAM must be refreshed thousands of times per second. It is used as main memory in computers because it is dense and cost-effective.
    • SRAM (Static RAM) : Uses multiple transistors (typically 4–6) per bit and does not need to be refreshed as long as power is supplied. It is vastly faster and more expensive than DRAM, making it ideal for CPU cache memory (L1, L2, L3).

    2. Generations of System RAM (DDR Standards) Modern desktop and laptop main memory uses DDR SDRAM (Double Data Rate Synchronous Dynamic RAM), which transfers data on both the rising and falling edges of the clock signal :-
    • DDR3 : Older standard operating at lower speeds (800–2133 MT/s) and 1.5V. Used in legacy hardware.
    • DDR4 : Widely used generation operating at 2133–3200+ MT/s and 1.2V, offering improved bandwidth and power efficiency over DDR3.
    • DDR5 : Current high-performance standard running at 4800–8000+ MT/s and 1.1V. Features higher density per module and built-in on-die ECC (Error-Correcting Code).

    3. Specialized Types of DRAM
    • LPDDR (Low Power DDR) : Optimized for low power consumption in mobile phones, tablets, ultra-thin laptops, and IoT devices (e.g., LPDDR4X, LPDDR5X). Often soldered directly onto the motherboard.
    • GDDR (Graphics DDR) : Specialized high-bandwidth RAM designed for Graphics Processing Units (GPUs) to handle high-volume visual and parallel compute operations (e.g., GDDR6, GDDR6X, GDDR7).
    • ECC RAM (Error-Correcting Code RAM) : Contains extra circuitry to detect and correct single-bit data corruption automatically. Used in enterprise servers, data centers, and critical workstations.
    • HBM (High Bandwidth Memory) : 3D-stacked memory silicon layered directly next to GPUs or AI accelerators via an interposer, providing ultra-wide memory buses and extreme bandwidth.

    4. Form Factors (Physical Modules)
    • DIMM (Dual In-line Memory Module) : Full-sized RAM sticks designed for desktop computers and enterprise servers.
    • SO-DIMM (Small Outline DIMM) : Compact RAM modules designed for laptops, mini-PCs, and small-form-factor devices.
    • CAMM2 (Compression Attached Memory Module) : Newer, ultra-thin modular memory standard replacing traditional SO-DIMMs in modern thin laptops to save space while providing higher speeds.

1.3   # Statement and Core knowledge of storage operations

Storage operations refer to the fundamental processes and actions performed by a computer's operating system and storage controller to manage, read, write, organize, and retrieve data on persistent storage media (such as Solid State Drives (SSDs), Hard Disk Drives (HDDs), or optical media). Unlike RAM, which holds data temporarily in volatile memory, storage operations handle non-volatile persistence—ensuring data remains intact even when the system is powered off.

# Core Storage Operations (The Basic Mechanics)

At the most basic level, all storage interaction revolves around four primary operations:
  • Read Operation : The CPU or an application requests data stored at a specific address (a file path or logical block address). The storage controller reads the electrical charge (SSD) or magnetic polarization (HDD) from the physical disk and loads it into system memory (RAM).
  • Write Operation : New or updated data from RAM is transferred to the storage drive, where the controller writes it to physical sectors/blocks for permanent saving.
  • Delete/Erase Operation : The operating system marks specific data blocks as unused or invalid in the file system table.
    In HDDs, data remains physically present until overwritten
    In SSDs, a TRIM command signals the controller to clean and erase flash memory cells during background garbage collection.
  • Modify/Update Operation : Changing existing file data. Depending on the storage architecture, this is done either by overwriting data in place (HDDs) or writing modified data to new blocks and invalidating the old ones (SSD Out-of-Place Writes).

# Key Technical Aspects of Storage Operations

Executing storage operations efficiently requires complex hardware and software coordination: 1. Input/Output (I/O) Operations & IOPS
  • IOPS (Input/Output Operations Per Second) : The standard metric used to evaluate how many individual read or write operations a drive can handle each second.
  • Sequential I/O : Reading or writing large continuous blocks of data (e.g., copying a large 4K video file).
  • Random I/O : Reading or writing small, scattered data blocks across different memory addresses (e.g., loading operating system boot files or running databases).

2. Storage Controllers & Protocols
Storage hardware relies on specialized protocols to process operational requests from the CPU:
  • NVMe (Non-Volatile Memory Express) : A high-speed protocol designed specifically for flash memory (SSDs) utilizing PCIe lanes. It can process over 64,000 command queues simultaneously with low latency.
  • SATA / AHCI : Older legacy protocols designed primarily for spinning hard drives with a single queue capable of holding only 32 commands.

3. File Systems & Data Mapping
Storage operations do not directly touch raw silicon or magnetic platters without an intermediary framework:
  • File Systems (NTFS, ext4, APFS) : Translate human-readable directory structures and files into physical sector addresses.
  • Logical Block Addressing (LBA) : A abstraction layer that allows the operating system to map data in numbered logical blocks without needing to know the physical geometry of the drive.

# Advanced Storage Maintenance Operations

To maintain performance, reliability, and security over time, storage controllers constantly run background management tasks:
  • Garbage Collection & Wear Leveling (SSDs) : Moves active data around flash blocks to ensure all memory cells wear out evenly and cleans invalid blocks to prepare them for future fast writes.
  • Defragmentation (HDDs) : Reorganizes scattered sectors of files on magnetic platters so the drive head can read data sequentially without excessive mechanical movement.
    • # Storage technologies can be categorized based on data persistence mechanisms, physical accessibility/location and data architecture models.

      1. By Data Persistence Mechanisms (Hardware Media)
      • Volatile Storage : Requires continuous electrical power to maintain data.
        System RAM (DRAM): Fast main memory used for running applications and OS processes.
        Cache Memory (SRAM): Ultra-fast memory embedded directly on the CPU die (L1, L2, L3 caches).
        • Non-Volatile Storage : Retains saved data permanently, even when the system is turned off.
          Solid State Drives (SSDs): Uses NAND flash memory with no moving parts, delivering high IOPS and low latency (NVMe or SATA).
          Hard Disk Drives (HDDs): Uses spinning magnetic platters and mechanical read/write heads for cost-effective, high-capacity storage.
          Optical Media: Uses lasers to read/write data on physical disks (CDs, DVDs, Blu-ray Disks).
          Magnetic Tape: High-capacity, slow-access linear storage used primarily for long-term enterprise archiving and cold backup.
        2. By Physical Location & Accessibility
        • Direct-Attached Storage (DAS) : Storage devices connected directly to a computer without passing through a network (e.g., internal SSDs/HDDs, USB flash drives, external hard drives).
        • Network-Attached Storage (NAS) : Dedicated file-level storage appliances connected over a LAN via IP protocols (SMB/NFS), allowing multiple users and devices to share files.
        • Storage Area Network (SAN) : A high-speed, dedicated enterprise network (typically using Fibre Channel or iSCSI) that provides block-level network access to consolidated storage.
        3. By Enterprise Architecture & Data Structure
        • Block Storage : Divides data into equal-sized raw blocks, each with a unique address. Ideal for high-performance databases, virtual machines, and SAN environments (e.g., NVMe drives, AWS EBS).
        • File Storage : Organizes data hierarchically in files and folders using paths, filenames, and metadata. Standard for personal computing and shared NAS folders (e.g., NTFS, ext4, SMB).
        • Object Storage : Stores data as discrete objects containing raw data, a unique identifier, and custom metadata. Designed to scale massively for unstructured data, cloud storage, and web assets (e.g., Amazon S3, Google Cloud Storage).
        4. By Cloud Deployment Model
        • Hot Storage : Fast-access online storage designed for frequently accessed data requiring immediate retrieval times (e.g., live databases, active websites).
        • Cold / Archive Storage : Low-cost storage designed for infrequently accessed data where higher retrieval latency (hours) is acceptable (e.g., compliance backups, historical logs).
        • Hybrid Storage : Combines fast local storage (or flash tiers) with scalable cloud backends to automatically move infrequently used data to cheaper storage tiers.



|| Always aim in direction ||





Post a Comment

0Comments
Post a Comment (0)