Build a two-input Boolean function
Choose a gate, or check the input pairs for which you want the output to be 1. Then set A and B to test one pair. Each bit is dimensionless: 1 means true and 0 means false.
Gate output
Y = A·B. For A = 1 and B = 0, Y = 1·0 = 0.
Writing an expression from the selected rows
Each pair has one matching AND term. In input order 00, 01, 10, 11, those terms are ¬A·¬B, ¬A·B, A·¬B and A·B. The symbol ¬ reverses a bit and the dot means AND. Join the checked terms with OR, written ∨. An empty selection gives constant 0.
For example, selecting 01 and 10 gives Y = (¬A·B) ∨ (A·¬B). With A = 1 and B = 0, the substitution is (0·0) ∨ (1·1) = 0 ∨ 1 = 1. This function is XOR: exactly one input is true.
Choose the gate by the condition you need
If a display should flag a mismatch between two configuration bits, use XOR. For inputs 1 and 1 the bits agree, so the flag stays 0. With 1 and 0 they disagree and the flag becomes 1. XNOR reverses the interpretation: its high output reports agreement.
| A | B | AND | OR | XOR | NAND | NOR | XNOR |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 | 1 | 0 | 0 |
| 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 | 1 |
Download the Two-input logic gates table (PDF)
Represent an asymmetric condition
Suppose A means “a sample is ready” and B means “the sample has already been logged.” To flag a new sample, select only pair 10. The expression becomes A·¬B. When logging finishes, B changes to 1 and the output falls to 0 even if A stays high.
Questions about truth tables
Why are there four rows but sixteen possible functions?
Two independent binary inputs give 2² = 4 combinations. Each row can independently output either value, so there are 2⁴ = 16 output patterns. The checkboxes can represent every one.
How do I make an inverter with two inputs shown?
To invert A, select 00 and 01. Both rows with A = 0 produce 1, regardless of B. Both rows with A = 1 produce 0.
What distinguishes OR from XOR when both inputs are on?
OR accepts either or both, so 11 produces 1. XOR accepts exactly one, so 11 produces 0. The other three rows are identical.
How can I check De Morgan’s law?
Select NAND. The only low row is 11. The expression ¬A ∨ ¬B also goes low only at 11. Matching outputs for all four possible inputs proves the two expressions describe the same two-input function.
Why is the displayed expression longer than the gate name?
The expression gives one term per selected row. For example, selecting 10 and 11 yields A·¬B ∨ A·B. Factoring out A gives A·(¬B ∨ B) = A. Both forms describe the same output.
Does a 1 specify a particular voltage?
Logic values describe states. A physical input’s high and low thresholds depend on the device and its supply. The truth table assumes settled inputs and describes neither switching delay nor transient glitches.
References: Texas Instruments, How to Select Little Logic, section 4.1, and HCMOS Design Considerations, figure 3.
Related Engineering Calculators
Continue exploring engineering
Find another tool, explore an animated mechanism, or browse resources by subject.