”;
In digital electronics, an OR Gate is a basic logic gate having two or more input lines and one output line. It performs the Boolean addition function.
In this chapter, we will explain the theory of the OR gate. Here, we will cover the definition of OR gate, its logic symbol, Boolean expression, truth table, operation, and circuits.
So, let’s get started with the basic definition of OR gate.
What is an OR Gate?
An OR gate is a type of logic gate used to perform logical addition. It can have two or more inputs and one output.
The output of the OR gate is low or logic 0 only when all its inputs are low or logic 0. For rest input combinations, the output of the OR gate is high or logic 1.
The logic symbols for a two-input and a three-input OR gate are shown in the following figure.
Here, A, B, and C are the input lines and Y is the output line.
Truth Table of OR Gate
The truth table is a table that shows the relationship between different input combinations and output.
The following is the truth table for a two-input OR gate −
Input | Output | |
---|---|---|
A | B | Y |
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
The following table shows the truth table for a three-input OR gate −
Input | Output | ||
---|---|---|---|
A | B | C | Y |
0 | 0 | 0 | 0 |
0 | 0 | 1 | 1 |
0 | 1 | 0 | 1 |
0 | 1 | 1 | 1 |
1 | 0 | 0 | 1 |
1 | 0 | 1 | 1 |
1 | 1 | 0 | 1 |
1 | 1 | 1 | 1 |
From these two truth tables, we can observe that the output of the OR gate is logic 0 or low, only when all the inputs to the OR gate are logic 0 or low. Otherwise, the output of the OR gate is high or logic 1.
Boolean Expression of OR Gate
The Boolean expression is a logical function that describes the mathematical relationship between inputs and output of the OR gate.
The Boolean expression of a two-input OR gate is given below −
Y = A + B
Here, A and B are input variables and Y is the output variable. This expression is read as “Y is equal to A OR B”. Here, the “+” sign represents the OR operation.
Similarly, the Boolean expression of a three-input OR gate is given below −
Y = A + B + C
Here, A, B, and C are the inputs and Y is the output.
In the same way, we can extend this expression to any number of input variables.
Working of OR Gate
The operation of a two input OR gate for different input combinations is described below −
- If A = 0 and B = 0, the output of the OR gate is Y = 0.
- If A = 0 and B = 1, the output of the OR gate is Y = 1.
- If A = 1 and B = 0, the output of the OR gate is Y = 1.
- If A = 1 and B = 1, the output of the OR gate is Y = 1.
This theory explains that when both inputs applied to an OR gate are low or logic 0, the output of the OR gate is also low or logic 0, otherwise it is high or logic 1.
Similarly, the working of a three-input OR gate is described below −
- If A = 0, B = 0, and C = 0, the output of the OR gate is Y = 0.
- If A = 0, B = 0, and C = 1, the output of the OR gate is Y = 1.
- If A = 0, B = 1, and C = 0, the output of the OR gate is Y = 1.
- If A = 0, B = 1, and C = 1, the output of the OR gate is Y = 1.
- If A = 1, B = 0, and C = 0, the output of the OR gate is Y = 1.
- If A = 1, B = 0, and C = 1, the output of the OR gate is Y = 1.
- If A = 1, B = 1, and C = 0, the output of the OR gate is Y = 1.
- If A = 1, B = 1, and C = 1, the output of the OR gate is Y = 1.
This theory also explains that the output of an OR gate is low or logic 0, only when all the three inputs are low or logic 0.
OR Gate using Transistors
We can implement the OR gate logic circuit using transistors. The implementation of a two-input OR gate using BJT transistors is shown in the following figure.
This OR gate circuit is also referred to as transistor-transistor logic (TTL) OR gate.
Working of Transistor OR Gate
The operation of the above shown transistor OR gate circuit is explained below −
When both inputs A and B are low, i.e., both A and B are connected to a low voltage (0 V), the transistors Q1 and Q2 remain off and act as open switches. The result is that the output line will directly connect to the ground potential. This makes the output of the circuit low or logic 0.
If the input A is low and the input B is high, the transistor Q1 will be off, and the transistor Q2 will turn on and acts as a closed switch. Thus, the supply voltage VCC will connect to the output line through the transistor Q2. Consequently, the output of the circuit is high or logic 1.
If the input A is high and the input B is low, the transistor Q1 will conduct, while the transistor Q2 will act as open switch. Thus, the output line will connect to the power supply VCC through the transistor Q1. Consequently, the output of the circuit is high or logic 1.
When both inputs A and B are high, both transistor Q1 and Q2 will conduct and act as the closed switches. The output line will connect to the power supply VCC through both transistors, this makes the output of the circuit high or logic 1.
This theory explains that when both inputs of the circuit are connected to logic 0 or low signal, the output is low or logic 0, otherwise the output is high or logic 1. Hence, this circuit implements the OR gate function.
We can add more transistors to the circuit to implement a higher order OR gate.
OR Gate using Switches
We can also use electrical switches, a battery, and a lamp to implement the OR logic operation. The following figure depicts the switching circuit diagram of a two-input OR gate.
The working of this circuit is explained below −
When both switches A and B are open, there is closed path for the flow of current. Hence, the lamp will remain off which represents the low or logic 0 output.
If the switch A is open and the switch B is closed, there is a closed path for the current flow through the switch B. In this case, the lamp will glow and represents the high or logic 1 output.
If the switch A is closed and the switch B is open, there will be a closed path for the current to flow through the switch A. In this case, the lamp will glow that represents the high or logic 1 output.
If both switches A and B are closed, there will a closed path for the current to flow. This will also turn on the lamp and represents the high or logic 1 output.
This way, the above shown switching circuit implements the OR gate operation. We can add more switches in parallel to implement a higher order OR gate logic.
OR Gate IC
In practice, the OR gate is available in the form of integrated circuits or ICs. The most popular OR gate IC is IC 7432 which is a Quad 2-input OR gate IC. It has four two-input OR gates.
The following figure depicts the pin and block diagram of the OR gate IC 7432.
The OR gate IC 7432 has 14 pins and it is a transistor-transistor logic (TTL) OR gate IC.
Conclusion
In conclusion, the OR gate is a basic logic gate having two or more input lines and one output line. It produces a low or logic 0 output only when all its inputs are low, otherwise it produces a high or logic 1 output.
In this chapter, we explained the theory of OR gate. Here, we covered only two and three-input OR gates. But the same theoretical and technical explanation is valid for OR gate with any number of inputs.
”;