Reference · Computing

Computing Primitives

The irreducible operations everything else is built from. Every programming language, every application, every system reduces to these layers. Master these and the rest becomes dialect.

These primitives are the foundation layer beneath The Language Map — what lives at and below binary before abstraction begins.

The Stack, Bottom Up

Each layer is built entirely from the one beneath it. The primitives at the bottom never change — they are etched in silicon. Everything above them is dialect.

Applications / Languages
Operating System
Instruction Set (ISA)
Fetch · Decode · Execute
Boolean / Logic Gates
Transistors / Physics
Physical Primitives

Where logic meets physics. These are not concepts — they are arrangements of matter that implement logical behavior through electrical properties.

Transistor
Switch

A semiconductor device that acts as a voltage-controlled switch. Above threshold voltage: current flows (1). Below: it doesn't (0). The physical implementation of a binary decision.

Voltage Threshold
Conversion

The boundary where analog electrical signal becomes digital value. Above the threshold is 1, below is 0. This is where the physical world becomes logical.

Clock Signal
Synchronization

A regular electrical pulse that synchronizes all processor components. Measured in gigahertz — billions of pulses per second. Every operation happens on the beat.

Bus
Communication

Copper traces on the motherboard that carry data between components. Carries address (where), data (what), and control (when) signals simultaneously.

Interrupt
Event

A signal that pauses the processor's current work to handle an external event — a keypress, a timer, a network packet. The mechanism by which the outside world gets the processor's attention.

Boolean Primitives

George Boole, 1854. Three operations that can represent any logical relationship. Implemented physically as arrangements of transistors called logic gates. Everything the processor does reduces to combinations of these.

AND
Both must be true

Output is 1 only when both inputs are 1. In hardware: current flows only when both switches are closed. The intersection operation.

OR
Either must be true

Output is 1 when at least one input is 1. In hardware: current flows when either switch is closed. The union operation.

NOT
Inversion

Output is the opposite of the input. 1 becomes 0, 0 becomes 1. The inverter. Every other logical operation can be derived from NOT combined with AND and OR.

XOR
Exclusive or

Output is 1 when inputs differ. True when one or the other but not both. Derived from the three primitives above — included because it appears constantly in arithmetic circuits.

Memory Primitives

Where state lives. The processor operates on values it can reach — the closer to the processor, the faster but smaller the storage. Speed and capacity trade off at every level.

Registers
On-chip · Fastest

A handful of storage locations built directly into the processor. This is where work actually happens. Values must be in a register to be operated on.

Cache
Near-chip · Fast

Small, fast memory between registers and RAM. Holds recently used data so the processor doesn't have to fetch from RAM repeatedly. Cache hit: fast. Cache miss: wait.

RAM
Main memory · Slower

Where programs and data live while in use. Large, volatile — contents lost when power is removed. The processor fetches from here into cache and registers.

Stack vs Heap
Memory regions

Stack: ordered, fast, automatic — holds function call state and local variables. Heap: flexible, manual — holds dynamically allocated data. Every program uses both.

The Processor Cycle

The three-step loop the processor runs continuously, billions of times per second. Every program that has ever run on any computer is this cycle applied to a sequence of instructions.

Fetch
Retrieve

The control unit reads the memory address in the Program Counter, retrieves the binary instruction stored there, loads it into the instruction register, and increments the Program Counter to the next address.

Decode
Interpret

Decode circuitry matches the opcode portion of the instruction against the hardwired instruction set — a hardware truth table. The matching entry activates the correct functional unit and routes the operands.

Execute
Perform

The activated functional unit performs the operation — ALU for arithmetic and logic, memory unit for loads and stores, branch unit for jumps. Result is written to a register or memory. Cycle repeats.

Program Counter
Special Register

The register that tracks where execution is. Holds the memory address of the next instruction to fetch. Increments automatically each cycle. Branch instructions write a new address here, redirecting execution flow.

Pipelining
Parallelism

While one instruction executes, the next is being decoded, and the one after that is being fetched. Three instructions in flight simultaneously. The logical model is sequential; the physical reality is overlapping.

Instruction Set Primitives

The hardwired commandments — patterns etched into silicon at design time that map directly to physical operations. The ~20–30 below account for the vast majority of instructions executed in any real program.

MOV — Data Movement
Most frequent

Move a value between registers, load from memory into a register, or store from a register to memory. 30–40% of instructions in typical programs. Programs spend most of their time moving data around.

ADD / SUB
Arithmetic

Integer addition and subtraction. The dominant arithmetic operations. Multiply and divide exist but are expensive in cycles — compilers avoid them where bit shifting can substitute.

CMP — Compare
Evaluation

Evaluates the relationship between two values and sets a flag — equal, greater than, less than. Produces no output itself. The flag is what branch instructions read. Comparison and branch are always a pair.

JMP / Branch
Flow control

Reads the flag set by a comparison and either redirects execution to a new address or continues to the next instruction. Every if statement, every loop, every conditional in every language reduces to this.

PUSH / POP
Stack operations

PUSH writes a value onto the top of the call stack. POP retrieves it. Every function call pushes the return address and local state; every return pops them. The stack is what makes function calls possible.

AND / OR / NOT / XOR
Logic operations

Boolean operations available at the instruction level. Used for checking flags, masking specific bits, toggling values. The same primitives from Layer 2, now addressable directly in code.

State

The concept underneath everything else.

Every primitive is an operation on state

State is the current condition of a system — the values in registers, the contents of memory, the position of the program counter, the flags set by the last comparison. Every instruction reads state, modifies state, or both. Fetch-decode-execute is the loop that advances state from one condition to the next. A program is a description of how state should evolve from an initial condition to a desired output.

State is also why bugs exist. A bug is state that diverged from what was intended at some point in the execution chain. Debugging is tracing state backwards to find where the divergence first occurred. The root bug is always the earliest point where state became wrong — everything after it is consequence.

From Primitives to Languages

The instruction set is the floor of the language map. Assembly gives the instructions human-readable names. Everything above assembly adds abstraction — higher-level expressions of the same underlying operations, compiled or interpreted back down to these primitives at runtime.

View The Language Map →