Basic Logic Gates
Logic gates are fundamental building blocks of digital electronic systems. They work with binary values, 0 and 1, and perform logical operations on one or more inputs to produce a binary output.
This note covers the three basic logic gates ā AND, OR, and NOT ā including their symbols, Boolean expressions, truth tables, and simple real-life examples.
What Are Logic Gates?
A logic gate is an electronic circuit that performs a logical operation on binary inputs and produces a binary output.
The two binary values are:
- 0 ā represents OFF or no signal
- 1 ā represents ON or a signal
A logic gate receives one or more inputs and produces an output according to a specific logical rule.
Binary Inputs
ā
Logic Gate
ā
Binary OutputExample: Basic decision-makingAn electronic system can receive signals from switches or sensors. A logic gate processes those signals according to its logical rule and produces an output such as turning a device ON or OFF.
Key Idea: Logic gates operate on binary values, 0 and 1, and produce binary outputs based on logical rules.
The Three Basic Logic Gates
The three fundamental logic gates are:
- AND gate
- OR gate
- NOT gate
Other logic gates can be constructed by combining basic logical operations.
AND Gate
An AND gate produces an output of 1 only when all inputs are 1.
For two inputs, A and B, the Boolean expression is:
Q = A Ā· BThe dot Ā· represents the AND operation.
AND Gate Truth Table
| A | B | Q = A Ā· B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
The output becomes 1 only when both inputs are 1.
Imagine two switches connected so that both switches must be ON before a light turns on.
Switch A = 1
AND
Switch B = 1
ā
Light = 1If either switch is OFF, the output is 0.
Remember: AND means all conditions must be true.
AND Gate with Three Inputs
An AND gate can have more than two inputs.
For three inputs, A, B, and C:
Q = A Ā· B Ā· CThe output is 1 only when A, B, and C are all 1.
Truth Table
| A | B | C | Q |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 |
For n binary inputs, the number of possible input combinations is:
2āæTherefore, three inputs have:
2³ = 8possible input combinations.
OR Gate
An OR gate produces an output of 1 when at least one input is 1.
For two inputs:
Q = A + BThe + symbol represents the OR operation in Boolean algebra.
OR Gate Truth Table
| A | B | Q = A + B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
The only situation that produces an output of 0 is when both inputs are 0.
Suppose a light should turn on when either one of two switches is ON.
Switch A = 1
OR
Switch B = 0
ā
Light = 1The light remains ON because at least one input is 1.
A door alarm could be designed so that it activates when any one of several sensors detects a problem. This represents the basic idea of an OR operation: at least one required condition is true.
Remember: OR means at least one condition must be true.
NOT Gate
A NOT gate has one input and produces the opposite or complement of that input.
If the input is 0, the output is 1.
If the input is 1, the output is 0.
The Boolean expression can be written as:
Q = AĢ
This means NOT A.
NOT Gate Truth Table
| A | Q |
|---|---|
| 0 | 1 |
| 1 | 0 |
Unlike AND and OR gates, the NOT gate normally has one input.
Example: Opposite outputIf a system is designed so that the output must be the opposite of the input:
Input = 0
ā
NOT
ā
Output = 1Similarly:
Input = 1
ā
NOT
ā
Output = 0Remember: NOT reverses the binary value.
Comparing AND, OR and NOT Gates
| Logic Gate | Main Rule | Number of Inputs | Boolean Expression |
|---|---|---|---|
| AND | Output is 1 when all inputs are 1 | 2 or more | Q = A Ā· B |
| OR | Output is 1 when at least one input is 1 | 2 or more | Q = A + B |
| NOT | Output is the opposite of the input | 1 | Q = AĢ
|
A useful way to remember them is:
AND ā ALL
OR ā AT LEAST ONE
NOT ā OPPOSITEBoolean Expressions
Logic gates can be represented using Boolean expressions. These expressions describe the logical relationship between the inputs and the output.
The basic expressions are:
- AND:
Q = A Ā· B - OR:
Q = A + B - NOT:
Q = AĢ
For:
Q = A Ā· Bthe output Q becomes 1 only when both A and B are 1.
Truth Tables
A truth table shows all possible combinations of inputs and the corresponding output of a logic gate.
For two binary inputs, there are:
2² = 4possible combinations.
For three binary inputs:
2³ = 8possible combinations.
Truth tables are useful for checking how a logic gate behaves for every possible input combination.
Key Idea: A truth table shows every possible combination of binary inputs and the corresponding output.
How Logic Gates Make Decisions
Logic gates allow electronic systems to make decisions automatically according to predefined logical conditions.
The general process is:
Input signals
ā
Logical operation
ā
Output decisionAn AND gate can be used when all required conditions must be satisfied.
An OR gate can be used when any one of several conditions should activate an output.
A NOT gate can be used when the required output is the opposite of the input.
Applications of Logic Gates
Logic gates are used as building blocks in many digital systems, including:
- Computers
- Calculators
- Digital control systems
- Electronic devices
- Automatic decision-making circuits
Complex digital circuits can be created by combining multiple logic gates.
Exam-Focused Points
Key Idea: An AND gate gives 1 only when all inputs are 1.
Key Idea: An OR gate gives 1 when at least one input is 1.
Key Idea: A NOT gate gives the complement of its input ā 0 becomes 1, and 1 becomes 0.
Quick Revision
- AND ā all inputs must be 1
- OR ā at least one input must be 1
- NOT ā gives the opposite output
- Logic gates work with binary values 0 and 1.
- A truth table shows possible input combinations and their outputs.
- For
nbinary inputs, there are 2āæ possible input combinations.
Summary
Logic gates are basic components of digital electronic systems. They use binary inputs and produce binary outputs according to specific logical rules.
The three basic gates are AND, OR, and NOT. The AND gate requires all inputs to be 1, the OR gate requires at least one input to be 1, and the NOT gate reverses the input value.
Understanding these gates, their truth tables, symbols, and Boolean expressions provides a foundation for studying more complex digital logic circuits.