Read this lesson as text

Logical Connectives (AND, OR, NOT)

Math for CS · Axiom Academy

AND, OR, NOT, XOR, NAND, NOR — the building blocks of digital logic A logical connective is an operator that combines or modifies propositions (statements that are either true or false) to form new propositions. They are the fundamental operations in Boolean algebra, digital circuits, and programming. We denote propositions by variables like p , q , r , and combine them using connectives. The simplest connective: it flips the truth value. If p is true, p is false, and vice versa. p q is true only when both operands are true. p q is true when at least one operand is true (inclusive or). p q is true when exactly one operand is true (but not both). NAND ( (p q) ) is AND followed by NOT. NOR ( (p q) ) is OR followed by NOT. NOT flips a single value; AND, OR, XOR combine two values. AND requires both true; OR requires at least one true; XOR requires exactly one true. NAND and NOR are universal — any circuit can be built from just one of them. These connectives map directly to logic gates in hardware and Boolean operators in code.

This is the written version of the interactive lesson above. See the full Math for CS course.