CSC 180.1 · Introduction to Computer Science and BASIC Programming
Our notes
2 min readLogic values
Boolean algebra (George Boole, 1854) works with two values: 1 (true) and 0 (false). It describes computer circuits.
Basic operations
| A | B | A AND B (A·B) | A OR B (A+B) | NOT A (A′) |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 |
Other gates
- NAND = NOT (A AND B): 0 only when both are 1.
- NOR = NOT (A OR B): 1 only when both are 0.
- XOR (exclusive OR, A ⊕ B): 1 when the inputs differ.
- XNOR: 1 when the inputs are the same.
NAND and NOR are universal gates: any circuit can be built from either alone.
Laws
| Law | AND form | OR form |
|---|---|---|
| Identity | A·1 = A | A+0 = A |
| Null | A·0 = 0 | A+1 = 1 |
| Idempotent | A·A = A | A+A = A |
| Complement | A·A′ = 0 | A+A′ = 1 |
| Commutative | A·B = B·A | A+B = B+A |
| Distributive | A·(B+C) = A·B + A·C | A + B·C = (A+B)·(A+C) |
| Absorption | A·(A+B) = A | A + A·B = A |
| De Morgan | (A·B)′ = A′ + B′ | (A+B)′ = A′·B′ |
Also double negation: (A′)′ = A.
Simplification example
Simplify X = A·B + A·B′.
X = A·(B + B′) (distributive) = A·1 (complement) = A.
Check with a truth table: when A = 1, one of the two terms is 1; when A = 0 both are 0 ✓.
Writing an expression from a truth table
Take each row where the output is 1, write the AND of the inputs (complementing those that are 0), then OR the terms (sum of products). For XOR: output 1 at (0,1) and (1,0), so A ⊕ B = A′·B + A·B′.
A useful circuit: the half adder
Adds two bits: Sum = A ⊕ B, Carry = A·B. Check: 1 + 1 gives Sum 0, Carry 1 (binary 10) ✓. Two half adders and an OR gate make a full adder.
Exams usually ask
- Draw the symbols and truth tables of the gates.
- State and prove (by truth table) De Morgan's laws.
- Simplify Boolean expressions and draw the circuit.
Common mistake
Writing (A·B)′ = A′·B′. De Morgan's law changes the operation: (A·B)′ = A′ + B′.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
Read
-
Boolean algebra
(opens en.wikipedia.org in a new tab)
Wikipedia, Boolean algebra, CC BY-SA 4.0 · licence
-
Logic gate
(opens en.wikipedia.org in a new tab)
Wikipedia, Logic gate, CC BY-SA 4.0 · licence
-
Truth table
(opens en.wikipedia.org in a new tab)
Wikipedia, Truth table, CC BY-SA 4.0 · licence
-
NOUN CIT 206: Discrete Structures
NOUN course book (PDF, about 2.7 MB). Logic, sets and Boolean algebra.
(opens nou.edu.ng in a new tab)
Watch
-
Best pick Boolean Logic & Logic Gates: Crash Course Computer Science #3
10 min · ≈ 45 MB · about ₦25
(opens youtube.com in a new tab)
-
Logic Gates | Boolean Algebra | Types of Logic Gates | AND, OR, NOT, NOR, NAND
22 min · ≈ 99 MB · about ₦56
(opens youtube.com in a new tab)
-
Introduction to Logic Gates & Boolean Algebra
9 min · ≈ 41 MB · about ₦23
(opens youtube.com in a new tab)
-
Introduction to Boolean Algebra (Part 1)
18 min · ≈ 81 MB · about ₦45
(opens youtube.com in a new tab)
-
Logic Gates, Truth Tables, Boolean Algebra AND, OR, NOT, NAND & NOR
54 min · ≈ 243 MB · about ₦136
(opens youtube.com in a new tab)
We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.