Boolean Algebra: Concepts, Laws, Logic Gates and K-Maps
Learn how Boolean expressions work, how to simplify them, and how they are used in digital circuits, programming, and database queries.
1. Introduction to Boolean Algebra
Boolean Algebra is a branch of mathematics used to represent and simplify logical operations. Unlike ordinary algebra, Boolean variables normally have only two possible values: 0 and 1.
In digital systems, these values can represent OFF and ON, FALSE and TRUE, or LOW and HIGH. Boolean Algebra provides the rules used to analyse digital logic and design electronic circuits.
Boolean Algebra was developed by George Boole in the nineteenth century. Today, it is used in digital circuit design, programming, search conditions, database queries, and computer architecture.
Key concepts
- Boolean variables normally have two values: 0 and 1.
- The three basic operations are AND, OR, and NOT.
- Truth tables show the output for every possible input combination.
- Boolean laws help simplify logical expressions.
- Logic gates implement Boolean operations in digital circuits.
2. Basic Boolean Operations
AND Operation (·)
The AND operation produces an output of 1 only when all inputs are 1. It is represented by a dot (·), or the dot may be omitted.
Example: A · B, or simply AB
| A | B | A · B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
OR Operation (+)
The OR operation produces an output of 1 when at least one input is 1.
Example: A + B
| A | B | A + B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
NOT Operation (')
The NOT operation produces the complement of its input. It changes 0 to 1 and 1 to 0.
Example: If A = 1, then A' = 0.
| A | A' |
|---|---|
| 0 | 1 |
| 1 | 0 |
3. Boolean Laws and Theorems
Boolean laws provide a systematic method for simplifying expressions. A simpler expression can reduce the number of gates required in a digital circuit.
| Law | Boolean Expressions |
|---|---|
| Identity law | A + 0 = A; A · 1 = A |
| Domination law | A + 1 = 1; A · 0 = 0 |
| Idempotent law | A + A = A; A · A = A |
| Complement law | A + A' = 1; A · A' = 0 |
| Commutative law | A + B = B + A; A · B = B · A |
| Associative law | A + (B + C) = (A + B) + C; A · (B · C) = (A · B) · C |
| Distributive law | A(B + C) = AB + AC; A + BC = (A + B)(A + C) |
| Absorption law | A + AB = A; A(A + B) = A |
De Morgan's Theorems
De Morgan's theorems are useful when simplifying complemented expressions.
- (A + B)' = A'B'
- (AB)' = A' + B'
4. Boolean Expressions, SOP and POS
A Boolean expression combines variables and Boolean operations to describe a logical condition. For example, F = AB + A'C contains the variables A, B, and C.
Sum of Products (SOP)
In SOP form, product terms are combined using OR operations. For example, F = AB + A'C + BC.
Product of Sums (POS)
In POS form, sum terms are combined using AND operations. For example, F = (A + B)(A' + C).
Minterms and Maxterms
A minterm is a product term in which every variable appears exactly once. A maxterm is a sum term in which every variable appears exactly once.
For two variables A and B, the minterms are A'B', A'B, AB', and AB. For a function containing n variables, there are 2n possible minterms and 2n possible maxterms.
5. Karnaugh Map (K-map) Simplification
A Karnaugh Map, or K-map, is a graphical method used to simplify Boolean expressions. It helps identify terms that can be grouped and reduced.
Common K-map sizes
- 2-variable K-map: 2 × 2 grid
- 3-variable K-map: 2 × 4 grid
- 4-variable K-map: 4 × 4 grid
Basic K-map rules
- For SOP simplification, group cells containing 1.
- Each group must contain 1, 2, 4, 8, or another power-of-two number of cells.
- Make groups as large as possible.
- Groups may overlap if doing so gives a simpler expression.
- Cells on opposite edges are considered adjacent.
- Cover all required 1s with the fewest and largest valid groups.
Worked example
Simplify: F(A, B) = A'B + AB' + AB
The expression is 1 for 01, 10, and 11. Grouping the adjacent cells on a two-variable K-map gives the terms A and B.
Therefore, F(A, B) = A + B.
6. Logic Gates
Logic gates are electronic circuits that perform Boolean operations. They are the building blocks of digital systems.
| Gate | Boolean Expression | Function |
|---|---|---|
| AND | Y = AB | Output is 1 only when all inputs are 1. |
| OR | Y = A + B | Output is 1 when at least one input is 1. |
| NOT | Y = A' | Produces the complement of the input. |
| NAND | Y = (AB)' | Produces the complement of AND. |
| NOR | Y = (A + B)' | Produces the complement of OR. |
| XOR | Y = A ⊕ B | Output is 1 when the inputs are different. |
| XNOR | Y = (A ⊕ B)' | Output is 1 when the inputs are the same. |
7. Applications of Boolean Algebra
Digital circuit design
Boolean Algebra is used to design and simplify combinational circuits, sequential circuits, adders, multiplexers, and many other digital systems.
Computer programming
Programs use Boolean logic to make decisions based on conditions. In many programming
languages, && represents AND, || represents OR,
and ! represents NOT.
Database queries
SQL uses Boolean operators to filter records. For example:
SELECT * FROM Students
WHERE Marks > 80 AND Subject = 'Computer Science';
A record is returned only when both conditions are true.
8. Worked Simplification Examples
Example 1
Simplify: F = A + AB
Using the absorption law, A + AB = A.
Therefore, F = A.
Example 2
Simplify: F = AB + AB'
Take A as the common factor: F = A(B + B').
Since B + B' = 1, F = A · 1 = A.
Therefore, F = A.
Example 3
Simplify: F = A'B'C + A'BC + AB'C + ABC
All four combinations of A and B are present, while C appears in every term. Therefore, F = C.
9. Quick Revision Points
- Boolean variables normally have two values: 0 and 1.
- The three basic Boolean operations are AND, OR, and NOT.
- NAND and NOR are universal gates.
- XOR gives 1 when inputs are different.
- XNOR gives 1 when inputs are the same.
- SOP means Sum of Products, while POS means Product of Sums.
- De Morgan's theorems interchange AND and OR while complementing variables.
- K-maps simplify Boolean functions graphically.
10. Practice Questions
- Construct truth tables for AND, OR, NOT, NAND, NOR, XOR, and XNOR gates.
- Simplify A + AB using Boolean laws.
- Apply De Morgan's theorem to (A + B + C)'.
- Write one SOP expression and one POS expression.
- Explain why NAND and NOR are universal gates.
- Simplify a Boolean expression using a two-variable or three-variable K-map.