All revision notes

Computer Studies Revision Notes

Logic Gates, Boolean Algebra, Truth Tables & Combinational Circuits

Construct truth tables and Boolean equations for AND, OR, NOT, NAND, NOR, XOR, and XNOR gates, apply De Morgan’s Laws, and trace multi-gate exam circuits accurately.

1. Basic Logic Gates (AND, OR, NOT)

A logic gate is an electronic building block inside a CPU that accepts one or more binary inputs (0 = LOW/FALSE, 1 = HIGH/TRUE) and outputs a single deterministic binary result. - NOT Gate (Inverter): Single input A, output Q = overline{A} (or A'). Inverts the input: 0 → 1, 1 → 0. - AND Gate: Output Q = A cdot B. Outputs 1 ONLY when ALL inputs are 1 (analogy: two switches wired in series). - OR Gate: Output Q = A + B. Outputs 1 when AT LEAST ONE input is 1 (analogy: two switches wired in parallel). For n binary inputs, a complete truth table always contains exactly 2^n rows (2 inputs → 4 rows; 3 inputs → 8 rows).

2. Universal & Derived Gates (NAND, NOR, XOR, XNOR)

- NAND Gate (Q = overline{A cdot B}): Inverted AND. Outputs 0 ONLY when both inputs are 1; outputs 1 in all other three cases. - NOR Gate (Q = overline{A + B}): Inverted OR. Outputs 1 ONLY when both inputs are 0. - Why NAND & NOR Are Called Universal Gates: Every other logic gate (NOT, AND, OR, XOR) can be constructed purely from combinations of NAND gates alone—or NOR gates alone. - XOR (Exclusive-OR) Gate (Q = A oplus B = overline{A}B + Aoverline{B}): Outputs 1 ONLY when the two inputs are DIFFERENT (0,1 → 1; 1,0 → 1; 0,0 → 0; 1,1 → 0). Used inside binary half-adders to compute the sum bit. - XNOR (Equivalence) Gate (Q = overline{A oplus B}): Outputs 1 when both inputs are IDENTICAL (0,0 → 1 and 1,1 → 1).

3. Worked Multi-Gate Truth Table & Boolean Evaluation

Evaluate the combinational circuit Q = (A cdot overline{B}) + (overline{A} cdot B) or trace X = overline{A + B} cdot C step-by-step by adding intermediate columns: Suppose a smart greenhouse triggers a cooling fan (F = 1) if Temperature is High (T = 1) AND NOT raining (R = 0), OR if Manual Override (M = 1) is pressed: F = (T cdot overline{R}) + M - Test Case 1 (T=1, R=1, M=0): overline{R}=0 implies (1 cdot 0) + 0 = 0 (Fan OFF because it is raining). - Test Case 2 (T=1, R=0, M=0): overline{R}=1 implies (1 cdot 1) + 0 = 1 (Fan ON). - Test Case 3 (T=0, R=1, M=1): (0 cdot 0) + 1 = 1 (Fan ON via manual override).

4. Boolean Algebra Laws, De Morgan’s Theorems & Examiner Traps

Boolean simplification reduces chip transistor count and power consumption: - Identity: A + 0 = A, A cdot 1 = A - Null / Dominance: A + 1 = 1, A cdot 0 = 0 - Idempotent: A + A = A, A cdot A = A - Complement: A + overline{A} = 1, A cdot overline{A} = 0 - De Morgan’s Laws ("Break the bar, change the sign"): overline{A cdot B} = overline{A} + overline{B}, qquad overline{A + B} = overline{A} cdot overline{B} Examiner Trap: In Boolean algebra, the symbol + means logical OR, NOT ordinary arithmetic addition—so 1 + 1 = 1 (never 2 or 10_2!). Also check the tiny inversion bubble at the tip of a gate symbol: an AND shape with a circle at the output is NAND, not AND.