3.1 Logic Values, Gates, and Truth Tables
Chapter 2 showed how a bit pattern can represent a number or character. We now ask a different question: how does hardware transform one bit pattern into another?
Digital circuits answer with logic. A logic value is the abstract value 0 or 1. In a physical circuit, designers assign voltage ranges to these values; the exact voltages depend on the technology. At this level, we work with the reliable abstraction:
| Logic value | Common interpretation | Example |
|---|---|---|
| 0 | false, low, inactive | button not pressed |
| 1 | true, high, active | button pressed |
The words “low” and “high” describe signal ranges, not necessarily exactly 0 volts and 5 volts.
A logic gate applies one small rule
A logic gate is a circuit whose output is determined by a rule applied to its inputs. A NOT gate has one input. The gates below have two inputs, named A and B.
| Gate | Output rule | Output is 1 when… |
|---|---|---|
| NOT | reverses one input | its input is 0 |
| AND | A and B are both 1 | |
| OR | in Boolean notation | at least one input is 1 |
| XOR | A and B differ | |
| NAND | NOT of AND | A and B are not both 1 |
| NOR | NOT of OR | A and B are both 0 |
Here, Boolean means OR, not ordinary arithmetic addition. In particular, under the OR rule. The symbol means exclusive OR.
A truth table checks every possible input
A truth table lists every input combination and its output. Two binary inputs have combinations:
| A | B | AND | OR | XOR | NAND | NOR |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 | 1 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 |
A single example is never enough to identify a gate. AND and XOR both output 0 for input 00, but their other rows differ. A complete truth table is a small, exhaustive test.
Lab 1 — identify gates by behavior
Switch A and B, compare the highlighted truth-table row, and use the complete four-bit output signature to identify each rule.
Check your understanding
Gates can be connected into a larger rule
The output of one gate can become the input of another. Consider:
The circuit first asks whether A and B differ. It then allows that result through only when C is 1.
Three inputs have possible combinations. To verify the complete circuit:
1. Choose one row, such as A=1, B=0, C=1.
2. Compute the intermediate signal: .
3. Compute the final output: .
4. Repeat for all eight rows.
This is a combinational circuit: once its input signals settle, its output depends only on the current inputs. It does not remember earlier inputs.
Lab 2 — build a circuit that passes all rows
Choose both gate stages and inspect every mismatch. The goal is not to make one lamp turn on by accident; it is to match the target function for all eight input combinations.
Check your understanding
Useful reasoning habits
- Name intermediate signals. Writing separates two manageable steps.
- Test boundary rows. All-zero and all-one inputs often expose an incorrect gate quickly.
- Do not confuse XOR with OR. They differ at input 11: OR outputs 1, XOR outputs 0.
- Do not infer a circuit from one observation. Different circuits can agree on several rows and still implement different functions.
The next section packages these small rules into reusable combinational blocks: decoders select one destination, multiplexers select one source, and an arithmetic logic unit selects one operation.