Boolean Algebra and Logic Gates
A logic gate is a circuit with one or more inputs and one output, working on 0 and 1.
Basic gates
| Gate | Expression | Output is 1 when |
|---|---|---|
| AND | A.B | both inputs are 1 |
| OR | A+B | at least one input is 1 |
| NOT | A' | the input is 0 (it inverts) |
| NAND | (A.B)' | not both inputs are 1 |
| NOR | (A+B)' | both inputs are 0 |
| XOR | A xor B | inputs are different |
| XNOR | (A xor B)' | inputs are the same |
Truth table for two inputs
| A | B | AND | OR | NAND | NOR | XOR | XNOR |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 | 0 |
| 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 | 1 |
Laws of Boolean algebra
| Law | Rule |
|---|---|
| Identity | A+0 = A and A.1 = A |
| Null (domination) | A+1 = 1 and A.0 = 0 |
| Idempotent | A+A = A and A.A = A |
| Complement | A+A' = 1 and A.A' = 0 |
| Double negation | (A')' = A |
| Commutative | A+B = B+A |
| Distributive | A.(B+C) = A.B + A.C |
| Absorption | A+A.B = A |
| De Morgan's laws | (A.B)' = A'+B' and (A+B)' = A'.B' |
Adders
- Half adder adds two bits: Sum = A XOR B, Carry = A AND B.
- Full adder adds two bits and a carry-in: Sum = A XOR B XOR Cin.
Keep practising
Notes are only half the work. Test yourself with questions and discuss doubts with other aspirants.
Prepared for exam revision from standard computer textbooks, Microsoft documentation and official sources. Features differ between Excel and Word versions (2016, 2019, 2021, 365) so check which version your exam follows. Found a mistake? Tell us.