Build a circuit, toggle the inputs and get its truth table and equation
Inputs (click to switch between 0 and 1, also on the diagram):
A logic gate is a circuit that gives a two-level output (0 or 1, low or high) depending on its inputs. With just three operations, AND (product), OR (sum) and NOT (negation), any logic function can be built; the other gates are combinations of these that are manufactured for convenience. Each card shows the American symbol (ANSI/IEEE 91, used in almost every textbook) and the rectangular IEC 60617 symbol, common in European drawings.
With NAND gates alone (or NOR gates alone) any other gate can be built. An inverter is a NAND with both inputs tied together; an AND is a NAND followed by an inverter; an OR is obtained by inverting the inputs of a NAND, by De Morgan's law:
That is why many integrated circuits and chip cells are based on NAND: in CMOS technology it is the fastest and smallest gate. Load the «XOR built only from NAND gates» example to see how four NANDs make an XOR.
| Function | 74HC series | CMOS 4000 series | Contents |
|---|---|---|---|
| NAND | 74HC00 | CD4011 | 4 two-input gates |
| NOR | 74HC02 | CD4001 | 4 two-input gates |
| NOT | 74HC04 | CD4069 | 6 inverters |
| AND | 74HC08 | CD4081 | 4 two-input gates |
| OR | 74HC32 | CD4071 | 4 two-input gates |
| XOR | 74HC86 | CD4070 | 4 two-input gates |
| Schmitt inverter | 74HC14 | CD40106 | 6 inverters with hysteresis |
Note: the 74HC02 (NOR) pinout differs from the other two-input parts, and the 4000 series pinouts do not match the 74HC ones either. Always tie unused inputs to 0 or 1 (whichever does not alter the function): a floating CMOS input can oscillate, draw current and heat the chip. To mix families or voltages, see logic level shifting.
Related: Boolean algebra, Karnaugh map, multiplexers, BCD to 7-segment decoder and ladder simulator.