Computer Science › How Computers Actually Work

Digital Logic & Computer Organization

0 of 27
  1. Boolean Algebra Laws and De Morgan's Laws

    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.

    Read →6 sections16 min
  2. Logic Gates and Truth Tables

    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.

    Read →6 sections15 min
  3. NAND as a Universal Gate

    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.

    Read →6 sections14 min
  4. Building Circuits from Gates

    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.

    Read →6 sections14 min
  5. Multiplexers and Decoders

    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.

    Read →6 sections15 min
  6. Binary Adders: Half, Full, and Ripple-Carry

    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.

    Read →6 sections15 min
  7. Designing an Arithmetic Logic Unit

    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.

    Read →6 sections15 min
  8. ALU Operation Selection and Flags

    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.

    Read →6 sections16 min
  9. Latches and Flip-Flops

    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.

    Read →6 sections15 min
  10. Clocking and Timing Basics

    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.

    Read →6 sections15 min
  11. Registers

    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.

    Read →6 sections15 min
  12. Finite State Machines: Design and Analysis

    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.

    Read →6 sections16 min
  13. From Flip-Flops to a Register File

    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.

    Read →6 sections14 min
  14. RAM Organization and Address Decoding

    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.

    Read →6 sections15 min
  15. What Is an ISA — the Hardware/Software Contract

    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.

    Read →6 sections15 min
  16. A Simple RISC-V-Style ISA

    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.

    Read →6 sections15 min
  17. Instruction Formats and Addressing Modes

    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.

    Read →6 sections15 min
  18. Assembly-to-Machine-Code Translation

    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.

    Read →6 sections14 min
  19. The Datapath: Registers, ALU, and Buses

    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.

    Read →6 sections13 min
  20. The Control Unit

    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.

    Read →6 sections14 min
  21. The Fetch-Decode-Execute Cycle

    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.

    Read →6 sections15 min
  22. Assembling a Complete Single-Cycle CPU

    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.

    Read →6 sections15 min
  23. Karnaugh Maps and Boolean Simplification

    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.

    Read →6 sections15 min
  24. Bits, Bytes, and Number Bases

    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.

    Read →6 sections12 min
  25. Unsigned and Two's-Complement Integers

    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.

    Read →6 sections15 min
  26. IEEE 754 Floating-Point

    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.

    Read →6 sections14 min

Digital Logic & Computer Organization

Part of the Computer Science curriculum.

Sort
1

From Propositional Logic to Boolean Algebra

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.

2

Boolean Algebra Laws and De Morgan's Laws

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.

3

Logic Gates and Truth Tables

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.

4

NAND as a Universal Gate

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.

5

Building Circuits from Gates

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.

6

Multiplexers and Decoders

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.

7

Binary Adders: Half, Full, and Ripple-Carry

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.

8

Designing an Arithmetic Logic Unit

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.

9

ALU Operation Selection and Flags

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.

10

Latches and Flip-Flops

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.

11

Clocking and Timing Basics

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.

12

Registers

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.

13

Finite State Machines: Design and Analysis

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.

14

From Flip-Flops to a Register File

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.

15

RAM Organization and Address Decoding

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.

16

What Is an ISA — the Hardware/Software Contract

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.

17

A Simple RISC-V-Style ISA

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.

18

Instruction Formats and Addressing Modes

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.

19

Assembly-to-Machine-Code Translation

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.

20

The Datapath: Registers, ALU, and Buses

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.

21

The Control Unit

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.

22

The Fetch-Decode-Execute Cycle

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.

23

Assembling a Complete Single-Cycle CPU

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.

24

Karnaugh Maps and Boolean Simplification

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.

25

Bits, Bytes, and Number Bases

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.

26

Unsigned and Two's-Complement Integers

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.

27

IEEE 754 Floating-Point

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.