3 / 63 · Concept
Basic gates: AND, OR, NOT and BUFFER
Connect circuit symbols with truth tables and combine gates to express conditions.
Lessons are free to read. Enroll to save your learning progress.
A gate is a function of every input combination
For inputs , AND outputs 1 when both are 1; OR outputs 1 when at least one is 1. NOT invertsInversion The NOT operation, which changes 0 to 1 and 1 to 0. A bar over an expression applies NOT to the entire expression beneath it. Learn more its input, and BUFFER passes the logic value through unchanged. A physical BUFFER also has drive strength and delay; here we consider only its logical function.
| a | b | AND | OR | NOT a | BUFFER a |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 1 |
Boolean algebraBoolean algebra Algebra of 0, 1, AND, OR and NOT. The plus sign usually denotes OR here, whose rules differ from integer addition. Learn more writes AND as , OR as , and NOT as . Thus here is not integer addition. The same operations are also written , and .
Read the symbol, inputs and truth table together
Select AND and OR below and check all four inputs: 00→01→10→11. Compare AND's flat input side and rounded output side with OR's curved input side. NOT indicates inversion with a small circle at the tip of a triangle; BUFFER is a triangle without that circle. These are common logic symbols; some standards use rectangular symbols instead.
| a | b | y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
OR means “at least one,” not “exactly one.” When both inputs are 1, OR outputs 1 while XOR, introduced in the next lessons, outputs 0. Missing even one truth-tableTruth table A table listing every possible input combination and its output. Changes over time are checked separately with waveforms. row can hide this distinction.
Connect conditions to form a circuit
A circuit that produces an output when permission is present and at least one of sensors is active is
First, OR produces ; AND then combines it with . When , the output is 0 regardless of the sensors. Three inputs have combinations, so compare the specification and implementation in all eight truth-table rows.
- a and b: Define the two sensor inputs
- OR: At least one active: t = a + b
- AND: Combine with permission e: y = e · t
Basic rules for reading RTL operators
a & b, a | b and ~a are bitwise AND, OR and NOT. For vectors a=0010 and b=0100, a & b=0000, but the logical condition a && b is 1 because both vectors are nonzero. Unary &a reduces all bits with AND. Bitwise, logical and reduction operators have different result widths and meanings.
A truth table describes values after the inputs settle. Correct symbols and equations do not eliminate propagation delayPropagation delay The time from an input change until the output settles to the correct value. Logical equivalence and timing behavior are separate properties. Learn more or momentary glitches.
Change the inputs
Try it yourself
Explain all four combinations with e=0 in y=e(a+b) at once. If it is incorrectly implemented as y=eab, which two inputs expose the error?
Read the explanation
When e=0, the final AND outputs 0 regardless of the OR result. With e=1 and (a,b)=(0,1) or (1,0), the correct circuit outputs 1 and the incorrect one outputs 0.