Computing Library › Classical Logic Gates
Classical Logic Gates
NOR Gate
The NOR gate outputs 1 only when all inputs are 0; it is an OR followed by inversion and is functionally complete.
What it does
NOR stands for NOT-OR. Its output is the complement of OR: it is 1 only when every input is 0, and 0 whenever any input is 1. The symbol is an OR shape with an output bubble.
Truth table
| A | B | A NOR B |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
Why it is special
Like NAND, NOR is a universal gate: any function can be built from NOR alone. The first integrated logic families and several classic latches were built primarily from NOR gates.
Building other gates from NOR
- NOT: tie both inputs together, giving NOR(A, A) = NOT A.
- OR: follow a NOR with a NOR-based inverter.
- AND: invert both inputs, then NOR them, per De Morgan's laws.
- Latches: cross-couple two NOR gates to store one bit.
Algebraic form
A NOR B equals NOT(A OR B). By De Morgan's laws this equals NOT A AND NOT B, so a NOR asserts only when both inputs are low.
In code
python
out = 1 - (a | b) # NOR of two 0/1 bits
out = not (a or b) # logical NOR
NOR and NAND are the two single-gate universal primitives, and both see heavy use in real silicon.