Logic Gates and Truth Tables
The and, or and not circuits that everything else is built from, and the table that fixes what each one outputs for every possible input.
What a learner can do afterwards
- Complete the truth table for AND, OR and NOT
- Work out the output of two gates wired together
- Match a written condition to the gates that would compute it
1 · Read
Text, pictures and sound are all stored as 1s and 0s. Logic gates are the tiny circuits that work on those bits. A NOT gate takes one input and flips it, so 1 becomes 0. An AND gate gives 1 only when both inputs are 1. An OR gate gives 1 when at least one input is 1.
A truth table lists every input pair beside its output. With two inputs there are four rows: 0 0, 0 1, 1 0 and 1 1. AND outputs 1 in only one row, 1 1. OR outputs 0 in only one row, 0 0.
Gates chain when one output feeds the next input. In (A AND B) OR C with A = 1, B = 0 and C = 1, the AND gives 0, then 0 OR 1 gives 1. A NOT can feed a gate too: it flips its input before the next gate sees it. Start at the gates nearest the inputs and write each output on its wire before moving on.
A written rule maps to gates through its joining words. A rule that needs both parts true uses AND. A rule that needs either part uses OR. A rule with the word not uses a NOT gate. Take an umbrella if it rains or snows, so that rule is an OR gate. The and, or and not in code follow the same rules.
NOT flips, AND needs both, OR needs one. Trace chains gate by gate, and turn the and, or and not in a rule into gates.
Lesson text, worked examples, flashcards and practice questions with worked steps, written for this dataset. The boots and graduation scenarios follow examples in the academy articles Logic gates and Compound Booleans with logical operators.
2 · Watch
En anglaisTake it off screen
Where it sits
Learn first
Optional connections
8 questions wait behind this lesson, each with its answer explained. Every answer feeds the sky: stars light as they are learned, and dim when it is time to come back.