2 / 36 · Concept
Gates and truth tables
Compare the output rules of AND, OR, NOT and XOR.
Les leçons sont gratuites. Inscrivez-vous pour enregistrer vos progrès.
La traduction n’est pas encore disponible. La leçon originale est affichée. (English)
Learning goals
- Read the truth tables of basic gates.
- Find the input combination where XOR differs from OR.
Check every input combination.
AND is 1 when both inputs are 1. OR is 1 when at least one is 1. XOR is 1 when the inputs differ. NOT inverts one input.
Two inputs have four combinations: 00, 01, 10 and 11. OR and XOR differ only at 11. A few matching examples do not establish equivalence.
| a | b | a & b | a | b | a ^ b |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | |
| 0 | 1 | 0 | 1 | 1 | |
| 1 | 0 | 0 | 1 | 1 | |
| 1 | 1 | 1 | 1 | 0 |
Separate bitwise operations from logical conditions.
a & b applies AND to matching bit positions. a && b tests whether both vectors are nonzero. They may look identical for one-bit inputs but differ for vectors.
4'b0010 & 4'b0100 is 0000, but logical AND is 1 because both values are nonzero. These tables use a two-state 0/1 model, without X or Z.
Modifier les entrées
Essayez vous-même
Find AND, OR and XOR for a=1, b=1.
Lire l’explication
AND=1, OR=1 and XOR=0. XOR requires exactly one of these two inputs to be 1.