CPUs & RAM Explained — How Computers Actually Think and Remember

Published: (January 2, 2026 at 03:02 PM EST)
3 min read
Source: Dev.to

Source: Dev.to

The CPU (Central Processing Unit)

The CPU is the component responsible for executing instructions. Every calculation, comparison, loop, condition, or function call in your code eventually becomes an operation executed by the CPU.

What the CPU Does

  • Performs mathematical operations
  • Moves data between memory locations
  • Makes decisions (branching)
  • Coordinates the execution of programs

Transistors: The Fundamental Building Block

A transistor is an electronic switch that can:

  • Allow electricity to pass
  • Block electricity

By combining billions of transistors, CPUs can perform:

  • Addition, subtraction, multiplication
  • Logical comparisons
  • Data movement and storage

Every instruction—e.g., C = A + B—is broken down into electrical operations performed by transistors.

CPU Speed

CPU speed is usually expressed as frequency, measured in Hertz (Hz):

  • 1 Hz = one electrical cycle per second
  • 1 MHz = one million cycles per second
  • 1 GHz = one billion cycles per second

Higher frequency means more cycles per second and more instructions executed per second, but it also draws more current, generating heat. Because temperature limits performance, CPUs require:

  • Fans
  • Heat sinks
  • Advanced cooling systems

Manufacturing Process

CPUs are built primarily from silicon (element 14), the main component of sand. The process:

  1. Purify sand and form a crystal wafer.
  2. Use extreme ultraviolet (EUV) lithography (developed mainly by ASML) to “print” transistors at an atomic scale, often placing them just 10–25 atoms apart.

This is one of the most advanced manufacturing processes humanity has created.

RAM (Random Access Memory)

RAM is the CPU’s working memory, storing:

  • Variables
  • Intermediate calculations
  • Program state
  • Data currently in use

RAM is fast but temporary; when the computer turns off, RAM is cleared.

Memory Hierarchy

LayerLocationSpeedCapacity
Registers / CacheInside the CPU1–20 nsVery limited
RAMSeparate chips~70 nsLarger, but still limited
Secondary StorageExternal (SSD/HDD)Much slowerVery large, permanent

Data must be loaded into RAM before the CPU can use it.

Key rule: The CPU cannot execute code directly from disk—everything must pass through RAM first.

CPU Architectures

Different architectures are optimized for various goals:

ArchitectureTypical UseOptimization
x86General‑purpose computing (desktops, laptops)Simpler instruction sets
ARMMobile devices & many modern laptopsEnergy efficiency (battery life)
Server‑grade (e.g., Xeon)High‑performance environmentsScalability, reliability

Each architecture reflects a different philosophy of computation.

Performance Improvements

Manufacturers increase performance by:

  • Shrinking transistors (smaller process nodes)
  • Raising clock speed (within thermal limits)
  • Adding multiple cores

Each core is effectively a mini‑CPU capable of executing instructions independently.

Core Variants (e.g., Intel Core i3, i5, i7)

Differences arise from:

  • Number of enabled cores
  • Cache size
  • Power limits

Chips are tested extensively, and their final classification depends on how many cores pass quality control.

Assembly Language and Compilation

Assembly language is the closest human‑readable representation of what the CPU actually understands.

During compilation:

  1. High‑level code (C#, Java, Python, etc.) → assembly
  2. Assembly → machine instructions

When the CPU executes code such as:

; Example pseudo‑assembly
MOV R1, #1      ; A = 1
MOV R2, #2      ; B = 2
ADD R3, R1, R2  ; C = A + B

It:

  • Allocates memory addresses in RAM
  • Loads values into registers
  • Executes arithmetic using transistors
  • Stores the result back into memory

All software—no matter how abstract—eventually becomes electrical activity.

Why Understanding CPUs and RAM Matters

  • Write more efficient code
  • Identify performance bottlenecks
  • Reason about memory usage
  • Debug low‑level issues
  • Design better systems

Abstractions are powerful, but mastery comes from understanding what lies beneath them. The CPU doesn’t “think” like a human; it switches transistors on and off billions of times per second, guided by your code. RAM doesn’t “remember” intelligently; it temporarily holds electrical states so the CPU can work efficiently. Together, they form the physical foundation of everything we build in software.

Back to Blog

Related posts

Read more »

The RGB LED Sidequest 💡

markdown !Jennifer Davishttps://media2.dev.to/dynamic/image/width=50,height=50,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%...

Mendex: Why I Build

Introduction Hello everyone. Today I want to share who I am, what I'm building, and why. Early Career and Burnout I started my career as a developer 17 years a...