Understanding Processors : babies to beast

Published: (December 24, 2025 at 02:40 AM EST)
7 min read
Source: Dev.to

Source: Dev.to

Basics

Transistors are the fundamental building blocks of modern computation.
A processor (CPU) is nothing more than billions of tiny transistors placed on a silicon chip.

  • Think of a transistor as a switch that can turn the flow of electrons on or off, just like a light‑switch controls a bulb.
  • By switching on (1) and off (0), transistors represent the binary data that all computers use.

When billions of transistors are combined, they can perform complex calculations. Every task you do on a device is ultimately reduced to a long string of 0s and 1s, processed by the CPU, and then converted back into human‑readable output.

The CPU – The Brain of Your Computer

The CPU (Central Processing Unit) executes instructions, decides which tasks run and in what order, and coordinates communication between memory, storage, and other hardware.

The Basic CPU Cycle

Every instruction follows the Fetch → Decode → Execute → Writeback cycle (also called the clock).

StageWhat Happens?
FetchThe instruction is retrieved from memory (RAM or cache).
DecodeThe CPU interprets the instruction (e.g., add, move, jump).
ExecuteThe actual work is performed – arithmetic, logic, memory access, etc.
WritebackThe result is stored back into registers or memory.

Simple Analogy

Imagine you’re playing a game and fire a bullet at an opponent:

  1. Fetch – Your action (“fire bullet”) is sent to the CPU.
  2. Decode – The CPU translates the action into binary so it can calculate the opponent’s health, position, etc.
  3. Execute – The CPU performs the calculations (bullet speed, distance, damage).
  4. Writeback – The game receives the result (“headshot, 100 % damage”) and updates the display.

Because this cycle repeats continuously, it creates a clock.

  • Clock speed = how fast the CPU completes each cycle.
  • 1 GHz = 1 billion cycles per second.
  • Higher GHz usually means higher per‑core performance, but it’s not the only factor.

Performance Factors Beyond Clock Speed

FactorWhy It Matters
ArchitectureDetermines how efficiently each cycle is used.
CacheStores frequently accessed data close to the cores.
Core CountMore cores can handle more tasks in parallel.
IPC (Instructions Per Cycle)Shows how many instructions a core can execute each clock tick. Higher IPC → better performance even at the same GHz.

Cores & Threads

  • Core = an independent processing unit (a “brain”).
  • Thread = a logical path that allows a core to work on multiple tasks simultaneously.

Example:

  • 4 cores, 8 threads → each core can handle 2 threads, giving the illusion of 8 simultaneous tasks.

Note: More cores do not automatically mean faster performance; the workload must be parallelizable, and the OS must schedule threads efficiently.

TDP (Thermal Design Power)

  • Measured in watts (W).
  • Low TDP → cooler, more power‑efficient (ideal for laptops).
  • High TDP → higher performance but requires robust cooling.

Transistor Size – “3 nm”, “2 nm”, etc.

Manufacturers advertise smaller process nodes (e.g., 3 nm, 2 nm) to indicate smaller transistors.

  • Why shrink transistors?

    • More transistors can fit on the same silicon area → higher performance and lower power consumption.
  • Why not just make the chip larger?

    1. Cost – Larger chips need more material, energy, and yield fewer chips per wafer, driving up price.
    2. Heat – Bigger chips generate more heat, complicating cooling.
    3. Physical limits – Devices (phones, laptops, servers) have limited space; large chips won’t fit in slim designs and are harder to connect to other components.

Therefore, the industry pushes for ever‑smaller transistor geometries.

The Limitation of Shrinking

If transistors become too small, electron leakage increases, which can cause power loss and reliability issues. This is a fundamental physical limit that engineers must manage as they move toward sub‑nanometer processes.

📚 Cleaned‑up Markdown – “CPU & Memory Hierarchy”

Why a Transistor Can’t Stop an Electron

“A transistor that is too small wouldn’t be able to prevent an electron from flowing (companies are already looking at other materials such as carbon).”

Registers – The Immediate Data Holders

┌──────────────────────────────────┐
│  Hold immediate data to          │
│  perform the action            │
└──────────────────────────────────┘

Analogy – Bullet‑Game Example
The register is like the player’s hand holding the book they are reading right now – the ultra‑urgent data needed for the next instruction.

Control Unit – The Brain

┌──────────────────────────────────┐
│         CONTROL UNIT 🧠           │
│  It's the brain, the core which   │
│  takes the decision               │
└──────────────────────────────────┘

Analogy – When the player clicks Fire, the control unit decides “How much damage does the bullet do? How much health is removed from the opponent?”

Other Immediate Data (Not As Critical As Registers)

┌──────────────────────────────────┐
│  Hold other immediate data which │
│  are important but not as         │
│  critical as data in Register    │
└──────────────────────────────────┘

Analogy – Game‑wide data such as menu settings, map selection, skin choices, voice chat, etc. are needed, but they aren’t required for the instant calculation of a bullet’s damage.

From Storage to RAM → CPU

  1. App start – The program is read from ROM / HDD / SSD and copied into RAM.
  2. While the app runs, it lives in RAM.
  3. A small portion of that RAM data is copied into the CPU for the fastest possible calculations.

House Analogy

Part of the ComputerReal‑world Analogy
ROM / HDD / SSDLibrary room (stores every book)
RAMStudy room (you keep the 10‑12 books you’ll need soon)
CPU / ProcessorTable on the study desk (the book you are reading right now)
CPU CacheYour hand – the book you are holding while you read it

CPU Cache – Tiny Ultra‑Fast Memory Inside the Processor

“While playing the game, a lot of data lives in RAM (characters, menus, maps, etc.). You don’t need all of it during a battle, so the most‑used pieces are cached inside the CPU.”

Cache Levels & Their Characteristics

LevelSize (typical)Speed / LatencyPositionShared?
L110‑12 KB per coreFastest (≈ 1 cycle)Closest to coreNo
L2100 KB – 1 MB per coreSlightly slowerA bit fartherNo
L310‑15 MB (total)Slowest of the threeShared among all coresYes
┌──────────────┐   → Fastest ⚡   (Smallest)   ← Closest to core
│   L1 Cache   │
└──────────────┘

┌──────────────┐   → A bit slower 🐇   (Larger)   ← Still per core
│   L2 Cache   │
└──────────────┘

┌──────────────┐   → Shared among cores 🐢   (Biggest)   ← A bit away
│   L3 Cache   │
└──────────────┘

What Gets Stored Where?

CacheTypical Contents
L1Ultra‑necessary data: current instruction, register values, immediate operands, branch predictor info.
L2Frequently accessed data that didn’t fit in L1: recent loop bodies, small data structures, decoded instructions.
L3Larger working sets shared across cores: shared libraries, texture data, large arrays.

Recap – The Whole Game‑Analogy Flow

  1. Game Opens – Files are fetched from Hard‑drive / ROM → loaded into RAM.
  2. Match Starts – Data is distributed across the memory hierarchy based on urgency.
┌─────────────────────────────────────────────────────────┐
│            HARDWARE MEMORY HIERARCHY                   │
└─────────────────────────────────────────────────────────┘

Register (Your Hand) – Ultra‑Immediate

┌──────────────────────────────────────────────────────────┐
│  REGISTER (In your HAND)                                 │
│  Ultra‑Immediate Data (being processed RIGHT NOW)        │
│──────────────────────────────────────────────────────────│
│  • Player’s current position                              │
│  • Opponent’s position                                    │
│  • Bullet speed                                           │
│  • Distance to target                                     │
│  • Real‑time damage calculations                          │
│  • Current instruction being executed                     │
│                                                            │
│  Size: Tiny (bytes)   Speed: Instant                      │
│  (the book you’re reading at THIS moment)                 │
└──────────────────────────────────────────────────────────┘

L1, L2, L3 – The Table, Drawer, & Closet

LevelWhat it holds (game‑style)
L1“What book am I holding right now?” – the current instruction & its operands.
L2“What books are on the desk?” – the last few instructions, small data structures.
L3“What books are on the shelf?” – larger assets that many cores may need (maps, textures).

RAM – The Study Room

All other game assets (menus, lobby UI, voice‑chat buffers, etc.) sit in RAM, ready to be pulled into a cache when required.

Storage (ROM/HDD/SSD) – The Library

The complete game files live here until the OS loads them.

Final Take‑aways

ComponentRoleAnalogy
RegisterHolds the data needed right this instant.Book in your hand.
L1 CacheStores the most‑frequently accessed bytes for one core.Book on the table right in front of you.
L2 CacheHolds the next‑most‑important data for the same core.Books on the desk drawer.
L3 CacheShared pool for all cores; larger but slower.Books on the nearby shelf.
RAMMain working memory for the whole program.Study room with a stack of books you’ll need soon.
ROM / HDD / SSDPermanent storage of the program and assets.Library where every book in the world is stored.

🎮 In a nutshell

When you fire a bullet in the game, the CPU pulls the ultra‑immediate data from registers, the very‑frequent data from L1, the still‑frequent data from L2, and the shared data from L3. Anything else stays in RAM until it becomes hot enough to be cached. This hierarchy lets the processor stay lightning‑fast without constantly running back to the slower memory layers.

Back to Blog

Related posts

Read more »