Hello friends, welcome to "ELECTRONICS ENCYCLOPEDIA". In this article we will study about the logic gates and its types.
WHAT ARE LOGIC GATES?
The logic gate is the most basic building block of any digital system, including computers. Each one of the basic logic gates is a piece of hardware or an electronic circuit that can be used to implement some basic logic expression.
WHAT IS TRUTH TABLE?
A truth table is a list of all possible combinations of input binary variables and the corresponding outputs of a logic system. The logic system output can be found from the logic expression, (often referred as boolean expression), that relates the output of the logic system with the inputs.
If a logic circuit has n binary inputs, its truth table will have 2ⁿ possible input combinations, or in other words 2ⁿ rows.
When the number of input binary variables is only one, then there are only two possible inputs, i.e. ‘0’ and ‘1’.
If the number of inputs is two, there can be four possible input combinations, i.e. 00, 01, 10 and 11.
Similarly, for three input binary variables, the number of possible input combinations becomes eight, i.e. 000, 001, 010, 011, 100, 101, 110 and 111. Watch the video on YouTube.
TYPES OF LOGIC GATE
1. NOT GATE
A NOT gate is a one-input, one-output logic circuit whose output is always the complement of the input. That is, a LOW input produces a HIGH output, and vice versa. A logic ‘0’ at the input produces a logic ‘1’ at the output, and vice versa. It is also known as a ‘complementing circuit’ or an ‘inverting circuit’. Figure given below shows the circuit symbol and the truth table of NOT gate.
NOT GATE
TRUTH TABLE OF NOT GATE
If X is the input to a NOT circuit, then its output Y is given by-
Y =(X)'
and reads as Y equals NOT X. Thus, if X=0 then Y=1 and if X=1 then Y=0.
2. AND GATE
An AND gate is a logic circuit having two or more inputs and one output.
"The output of an AND gate is HIGH only when all of its inputs are in the HIGH state. In all other cases, the output is LOW."
Output of the AND gate is a logic ‘1’ only when all of its inputs are in logic ‘1’ state. In all other cases, the output is logic ‘0’. The logic symbol and truth table of a two-input AND gate are shown in figure below.
AND GATE
TRUTH TABLE OF AND GATE
The AND operation on two independent logic variables A and B is written as
Y =A.B
and it is read as "Y equals A AND B" (not as A multiplied by B).
3. OR GATE
An OR gate is a logic circuit with two or more inputs and one output.
"The output of an OR gate is LOW only when all of its inputs are LOW , for all other possible input combinations, the output is HIGH".
The output of an OR gate is a logic ‘0’ only when all of its inputs are at logic ‘0’. For all other possible input combinations, the output is a logic ‘1’.
Figure below shows the circuit symbol and the truth table of a two-input OR gate.
OR GATE
TRUTH TABLE OF OR GATE
The operation of a two-input OR gate is explained by the logic expression
Y =A+B
and reads as "Y equals A OR B" (not as A plus B).
4. NAND GATE
NAND stands for "NOT AND". An AND gate followed by a NOT circuit makes it a NAND gate .
"Output of NAND gate is low only when all the inputs are high and if any or all of the inputs are low, then the output will be high."
The output of a NAND gate is a logic ‘0’ when all its inputs are a logic ‘1’. For all other input combinations, the output is a logic ‘1’.
Figure below shows the circuit symbol of a two-input NAND gate. The truth table of a NAND gate is obtained by complementing the output entries of the AND gate.
NAND GATE
TRUTH TABLE OF NAND GATE
NAND gate operation is logically expressed as
Y=(A.B)'
and reads as "Y equals A NAND B"
In general, the Boolean expression for a NAND gate with more than two inputs can be written as
Y = (ABCD)'
5. NOR GATE
NOR Gate NOR stands for NOT OR. An OR gate followed by a NOT circuit makes it a NOR gate
"Output is high when no input is high but the output is low when any or all inputs are high"
The output of a NOR gate is a logic‘1’ when all its inputs are logic‘0’,for all other input combinations, the output is a logic ‘0’.
Figure given below shows the truth table and logic diagram of NOR gate. The truth table of a NOR gate is obtained from the truth table of an OR gate by complementing the output entries.
NOR GATE
TRUTH TABLE OF NOR GATE
The output of a two-input NOR gate is logically expressed as
Y =(A+B)'
6. EX-OR GATE
The EXCLUSIVE-OR gate, commonly written as EX-OR gate, is a two-input, one-output gate. As per definition-
"Output is high when either of the input is high , Output is low when both the input are either low or high ."
IN OTHER WORDS , OUTPUT IS HIGH ONLY WHEN ODD NUMBER OF '1s' APPEAR AT THE INPUT.
The output of a multiple-input EX-OR logic function is a logic ‘1’ when the number of 1s in the input sequence is odd and a logic ‘0’ when the number of 1s in the input sequence is even.
Figure given below shows the truth table and the logic diagram of a two-input EX-OR function.
LOGIC DIAGRAM ANDTRUTH TABLE OF EX-OR GATE
The output of a two-input EX-OR gate is expressed by
Y =A⊕B=A'B+AB'
7. EX-NOR GATE
EXCLUSIVE-NOR (commonly written as EX-NOR) means NOT of EX-OR, i.e. the logic gate that we get by complementing the output of an EX-OR gate.
"Output is high when both the inputs are identical (i.e both are either low or high), otherwise the output is low."
In general, the output of a multiple-input EX-NOR logic function is a logic ‘0’ when the number of 1s in the input sequence is odd and a logic ‘1’ when the number of 1s in the input sequence is even.
Figure given below shows its circuit symbol along with its truth table. The truth table of an EX-NOR gate is obtained from the truth table of an EX-OR gate by complementing the output entries.
EX-NOR GATE
TRUTH TABLE OF EX-NOR GATE
The output of two-input EX-NOR gate is expressed by