Computer Science › How Computers Actually Work
The same ∧, ∨, ¬ connectives already covered as formal logic, now studied as an algebraic system in their own right — the exact mathematics every digital circuit in this discipline is built from.
The algebraic rules — commutativity, associativity, distributivity, and De Morgan's laws — that let a boolean expression be rewritten into a different, equally correct, but often cheaper-to-build form.
AND, OR, NOT, NAND, NOR, and XOR as physical circuits — each one a direct, tiny hardware realization of a boolean connective, with a truth table as both its specification and its test.
Every other gate — AND, OR, NOT, everything — can be built from NAND gates alone, a genuinely surprising fact that's the entire reason real chips are manufactured from one repeated building block.
Wiring individual gates together into a larger circuit that computes a more complex boolean function — the same divide-and-conquer idea already familiar, applied to hardware instead of code.
A multiplexer selects one of several inputs to pass through based on a control signal; a decoder does the reverse, activating exactly one output line based on a binary input — two small, reusable circuits that show up everywhere in a real CPU.
A half adder adds two bits; a full adder adds two bits plus a carry-in; chaining full adders together, one per bit position, builds an adder for numbers of any width — arithmetic, entirely from gates.
A single circuit that can perform many different operations — add, subtract, AND, OR, compare — on two inputs, with a control signal selecting which one to actually produce this cycle.
Beyond the main result, an ALU also reports a handful of one-bit flags — zero, negative, overflow, carry — the exact signals a CPU's control logic reads to decide whether a conditional branch should actually jump.
Every circuit so far has had no memory — its output depends only on its current input. A latch, and its clock-synchronized cousin the flip-flop, is the smallest circuit that can hold a single bit of state over time.
A shared clock signal that tells every flip-flop in a circuit exactly when to update — without it, different parts of a circuit could disagree about the current state at the same instant.
A group of flip-flops, one per bit, clocked together — a single circuit that holds an entire word of state at once, and the smallest unit of storage a CPU actually reads from and writes to directly.
A register holding the current state, plus combinational logic computing the next state and the outputs — the general pattern every sequential circuit with real behavior, including a CPU itself, is built from.
A small, fast bank of registers, each individually addressable and selected by a decoder — the CPU's own scratch space, and the direct hardware ancestor of the array already familiar as a data structure.
Scaling a register file up to a much larger memory array using a decoder tree to select one row from millions — the actual circuit behind the O(1) random access already taken for granted as an array's defining property.
An instruction set architecture is the exact vocabulary of operations a processor promises to support — the boundary that lets software be written without knowing how the hardware underneath actually implements any of it.
A small, real, open teaching instruction set — a handful of loads, stores, arithmetic, and branch instructions — small enough to fully implement in hardware, and the concrete ISA this discipline's CPU actually executes.
How an instruction's 32 bits are carved up into an opcode, register numbers, and an immediate value or offset — and the different ways an instruction can specify where its actual data lives.
Translating a human-readable assembly instruction into the exact bit pattern a CPU actually fetches and decodes — the mechanical, one-to-one process an assembler automates.
Wiring the register file, the ALU, and the memory together with buses and multiplexers — the physical path data actually flows through on its way to becoming an instruction's result.
A finite state machine, built from exactly the sequential-circuit ideas already covered, that reads an instruction's opcode and sets every multiplexer and control line in the datapath to make that specific instruction happen.
Every single cycle, a CPU fetches the next instruction, decodes which operation it names, executes it through the datapath, and updates the program counter — the same three-step loop, repeated billions of times a second.
Every piece built in this discipline — gates, the ALU, registers, memory, the datapath, the control unit — wired together into one working, if simple, general-purpose computer, capable of running real programs from this ISA.
A grid laid out so that adjacent cells differ in exactly one input bit — a visual technique for spotting which terms of a boolean expression can be merged away, turning a large circuit into a genuinely smaller one.
A bit as the smallest unit of information a machine can hold, and binary, octal, and hexadecimal as three different ways of writing down the exact same underlying pattern of bits.
Representing negative numbers in binary without a separate sign bit — two's complement, the scheme every real machine actually uses, chosen specifically because it makes addition and subtraction use the exact same circuit.
Representing a fraction in binary using a sign, an exponent, and a mantissa — the same standard every real machine follows, and the exact reason 0.1 + 0.2 doesn't print as 0.3.
Part of the Computer Science curriculum.
The same ∧, ∨, ¬ connectives already covered as formal logic, now studied as an algebraic system in their own right — the exact mathematics every digital circuit in this discipline is built from.
The algebraic rules — commutativity, associativity, distributivity, and De Morgan's laws — that let a boolean expression be rewritten into a different, equally correct, but often cheaper-to-build form.
AND, OR, NOT, NAND, NOR, and XOR as physical circuits — each one a direct, tiny hardware realization of a boolean connective, with a truth table as both its specification and its test.
Every other gate — AND, OR, NOT, everything — can be built from NAND gates alone, a genuinely surprising fact that's the entire reason real chips are manufactured from one repeated building block.
Wiring individual gates together into a larger circuit that computes a more complex boolean function — the same divide-and-conquer idea already familiar, applied to hardware instead of code.
A multiplexer selects one of several inputs to pass through based on a control signal; a decoder does the reverse, activating exactly one output line based on a binary input — two small, reusable circuits that show up everywhere in a real CPU.
A half adder adds two bits; a full adder adds two bits plus a carry-in; chaining full adders together, one per bit position, builds an adder for numbers of any width — arithmetic, entirely from gates.
A single circuit that can perform many different operations — add, subtract, AND, OR, compare — on two inputs, with a control signal selecting which one to actually produce this cycle.
Beyond the main result, an ALU also reports a handful of one-bit flags — zero, negative, overflow, carry — the exact signals a CPU's control logic reads to decide whether a conditional branch should actually jump.
Every circuit so far has had no memory — its output depends only on its current input. A latch, and its clock-synchronized cousin the flip-flop, is the smallest circuit that can hold a single bit of state over time.
A shared clock signal that tells every flip-flop in a circuit exactly when to update — without it, different parts of a circuit could disagree about the current state at the same instant.
A group of flip-flops, one per bit, clocked together — a single circuit that holds an entire word of state at once, and the smallest unit of storage a CPU actually reads from and writes to directly.
A register holding the current state, plus combinational logic computing the next state and the outputs — the general pattern every sequential circuit with real behavior, including a CPU itself, is built from.
A small, fast bank of registers, each individually addressable and selected by a decoder — the CPU's own scratch space, and the direct hardware ancestor of the array already familiar as a data structure.
Scaling a register file up to a much larger memory array using a decoder tree to select one row from millions — the actual circuit behind the O(1) random access already taken for granted as an array's defining property.
An instruction set architecture is the exact vocabulary of operations a processor promises to support — the boundary that lets software be written without knowing how the hardware underneath actually implements any of it.
A small, real, open teaching instruction set — a handful of loads, stores, arithmetic, and branch instructions — small enough to fully implement in hardware, and the concrete ISA this discipline's CPU actually executes.
How an instruction's 32 bits are carved up into an opcode, register numbers, and an immediate value or offset — and the different ways an instruction can specify where its actual data lives.
Translating a human-readable assembly instruction into the exact bit pattern a CPU actually fetches and decodes — the mechanical, one-to-one process an assembler automates.
Wiring the register file, the ALU, and the memory together with buses and multiplexers — the physical path data actually flows through on its way to becoming an instruction's result.
A finite state machine, built from exactly the sequential-circuit ideas already covered, that reads an instruction's opcode and sets every multiplexer and control line in the datapath to make that specific instruction happen.
Every single cycle, a CPU fetches the next instruction, decodes which operation it names, executes it through the datapath, and updates the program counter — the same three-step loop, repeated billions of times a second.
Every piece built in this discipline — gates, the ALU, registers, memory, the datapath, the control unit — wired together into one working, if simple, general-purpose computer, capable of running real programs from this ISA.
A grid laid out so that adjacent cells differ in exactly one input bit — a visual technique for spotting which terms of a boolean expression can be merged away, turning a large circuit into a genuinely smaller one.
A bit as the smallest unit of information a machine can hold, and binary, octal, and hexadecimal as three different ways of writing down the exact same underlying pattern of bits.
Representing negative numbers in binary without a separate sign bit — two's complement, the scheme every real machine actually uses, chosen specifically because it makes addition and subtraction use the exact same circuit.
Representing a fraction in binary using a sign, an exponent, and a mantissa — the same standard every real machine follows, and the exact reason 0.1 + 0.2 doesn't print as 0.3.