Logic gates and truth tables#
| A | B | A AND B | A OR B | NOT A | A NAND B | A NOR B | A XOR B |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
NAND and NOR are universal gates - any circuit can be built from them alone.
हिंदी में समझें
AND गेट तभी 1 देता है जब दोनों इनपुट 1 हों, OR तब जब कोई भी एक इनपुट 1 हो, और NOT इनपुट को उलट देता है। NAND और NOR को सार्वत्रिक (universal) गेट कहते हैं क्योंकि इनसे कोई भी परिपथ बनाया जा सकता है।
Laws of Boolean algebra#
- Identity: A + 0 = A, A · 1 = A. Null: A + 1 = 1, A · 0 = 0.
- Idempotent: A + A = A. Complement: A + A′ = 1, A · A′ = 0. Involution: (A′)′ = A.
- De Morgan's laws: (A + B)′ = A′ · B′ and (A · B)′ = A′ + B′.
Try it - truth tables in Python#
▶ Try it YourselfPython
Exam tips#
- Draw the circuit for an expression like (A + B)·C′ and write its truth table; verify De Morgan's law with truth tables.