Question
Question: How many types of logical operators are there?...
How many types of logical operators are there?
Solution
Expressions that produce Boolean data type values are separated into two groups in most languages. The expressions of one group use relational operators, while the expressions of the other group use logical operators.
The logical operators are frequently used to aid in the creation of a test expression that regulates program flow. Because they produce a Boolean answer or value when evaluated, this form of expression is also known as a Boolean expression.
Here we are going to learn about types of logical operators.
Complete step-by-step solution:
A Boolean variable's value can be tested or adjusted using logical operators.
Logical operators are divided into various types. They are,
OR Gate
AND Gate
NOT Gate
XOR Gate
These gates can also be found in pairs or in groups of one or two. As a result, we have
NAND Gates,
NOR Gates,
EXOR Gates,
EXNOR Gates.
OR Gate:
If one or more inputs reach state1, the output of an OR gate will also reach state1.
Y=A+B, or Yequals A ‘OR’ B, is the Boolean equation for OR gate.
Truth table:
A | B | Y=A+B |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
AND Gate:
If and only if all of the inputs are in state 1, the output of an AND gate will be state 1.
AND gate's Boolean expression isY=A.B.
Truth table:
A | B | Y=A+B |
---|---|---|
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
NOT Gate:
The output of a NOT gate reaches state 1 only if and only if the input does not reach state 1.
Boolean expression is Y = \mathop A\limits^{\\_\\_\\_\\_} , read as Yequals NOT A
Truth table:
A | Y = \mathop A\limits^{\\_\\_\\_\\_} |
---|---|
0 | 1 |
1 | 0 |
When the three gates (OR, AND, and NOT) are coupled in different ways, we get basic logic gates like NAND and NOR, which are the universal building blocks of digital circuits.
NAND Gate:
The AND and NOT gates are combined in this basic logic gate.
The Boolean expression of the NAND gate is Y=A.−B
Truth table:
A | B | Y = A\mathop .\limits^\\_ B |
---|---|---|
0 | 0 | 1 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
NOR Gate:
The OR and NOT gates are combined in this gate.
The Boolean expression of NOR gate is Y = A\mathop + \limits^{\\_\\_} B
Truth table:
A | B | Y = A\mathop + \limits^{\\_\\_} B |
---|---|---|
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 0 |
Exclusive-OR gate (XOR Gate):
In an XOR gate, the output of a two-input XOR
gate achieves state 1 if just the input is added.
Boolean expression of the XOR gate is A.\mathop B\limits^{\\_\\_} + \mathop A\limits^{\\_\\_\\_} .B
Y=A⊕B
Truth table,
A | B | Y=A⊕B |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
Exclusive-NOR Gate (XNOR Gate):
When both inputs are the same, that is, both 0 or both 1, the output of an XNOR gate is state 1.
Boolean expression of XNOR gate, Y = (\mathop {A \oplus B)}\limits^{\\_\\_\\_\\_\\_\\_\\_} = (A.B + \mathop A\limits^{\\_\\_\\_} .\mathop B\limits^{\\_\\_} )
Truth table,
A | B | Y = (\mathop {A \oplus B)}\limits^{\\_\\_\\_\\_\\_\\_\\_} = (A.B + \mathop A\limits^{\\_\\_\\_} .\mathop B\limits^{\\_\\_} ) |
---|---|---|
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
Note: Application for Logic gates:
The applications of logic gates are numerous, but they are mostly determined by their mode of operation or truth table. Basic logic gates are found in a safety thermostat, a push-button lock, an automatic watering system, a light-activated burglar alarm, and a variety of other electronic devices.
If the processes are advanced, one of the key advantages is that basic logic gates can employ a variety of different combinations. Furthermore, the number of gates that can be used in a single device is unlimited. However, due to the device's physical limitations, it may be limited. A logic gate area unit array can be found in digital integrated circuits (ICs).