Boolean Logic and Logic Gates
Explore the binary decision-making at the heart of all digital computers using logic gates.
At the core of every digital computer, smartphone, and electronic device are circuits that make simple decisions based on the principles of Boolean logic. Developed by George Boole in the 19th century, this system of algebra deals with two values: TRUE (represented by the binary digit 1) and FALSE (represented by 0). Every complex operation a computer performs is broken down into millions of these simple true/false decisions.
These decisions are physically implemented by logic gates, which are the fundamental building blocks of digital circuits. A logic gate is an electronic circuit that takes one or more binary inputs and produces a single binary output. The Cambridge O Level syllabus requires you to understand several key logic gates.
### Primary Logic Gates
### Combination Logic Gates
These gates are derived from the primary gates.
### Truth Tables
A truth table is a crucial tool used to represent the output of a logic gate or a more complex logic circuit for all possible combinations of its inputs. For a circuit with 'n' inputs, the truth table will have 2ⁿ rows. For a 2-input gate (like AND, OR, XOR), there are 2² = 4 possible input combinations (00, 01, 10, 11).
Example Truth Table for a 2-Input AND gate:
| A | B | Q (A.B) |
|---|---|---------|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
### Designing Simple Logic Circuits
Individual logic gates can be combined to create logic circuits to perform more complex tasks. To analyse or design a circuit, you follow a clear process:
Example Circuit: Consider the expression **Q = (A . B) + C**.
Key Points to Remember
- 1Boolean logic is a system of reasoning using two values: TRUE (1) and FALSE (0).
- 2Logic gates are electronic circuits that perform Boolean operations on binary inputs.
- 3The three fundamental gates are AND (output is 1 if all inputs are 1), OR (output is 1 if any input is 1), and NOT (inverts the input).
- 4NAND and NOR gates are known as 'universal gates' because any other logical function can be built from them.
- 5The XOR (Exclusive-OR) gate produces a 1 output only when its inputs are different.
- 6A truth table systematically lists all possible input combinations for a logic circuit and shows the corresponding output for each.
- 7Logic circuits are created by connecting the outputs of some logic gates to the inputs of others to perform complex tasks.
- 8Boolean expressions use operators like . (AND), + (OR), and a bar (NOT) to represent the function of a logic circuit algebraically.
Pakistan Example
Logic Gates in a UPS/Generator Automatic Transfer Switch (ATS)
In many homes and businesses in Pakistan, an Automatic Transfer Switch (ATS) is used to switch from the main grid power (WAPDA/K-Electric) to a backup UPS or generator during load-shedding. A simple logic circuit controls this. Let Input **A** be 'Grid Power Available' (1=Yes, 0=No). The system should only activate the generator when grid power is NOT available. This requires a **NOT** gate. The condition to start the generator could be expressed as: 'Start Generator if (**NOT A**)'. This ensures the generator only runs when needed, preventing fuel wastage and damage, a practical application of Boolean logic seen daily across the country.
Quick Revision Infographic
Computer Science — Quick Revision
Boolean Logic and Logic Gates
Key Concepts
Logic Gates in a UPS/Generator Automatic Transfer Switch (ATS)
In many homes and businesses in Pakistan, an Automatic Transfer Switch (ATS) is used to switch from the main grid power (WAPDA/K-Electric) to a backup UPS or generator during load-shedding. A simple logic circuit controls this. Let Input **A** be 'Grid Power Available' (1=Yes, 0=No). The system should only activate the generator when grid power is NOT available. This requires a **NOT** gate. The condition to start the generator could be expressed as: 'Start Generator if (**NOT A**)'. This ensures the generator only runs when needed, preventing fuel wastage and damage, a practical application of Boolean logic seen daily across the country.