Logic Gates Notes
Logic Gates Notes
Logic Gates
A digital circuit with one or more input signals but only one output signal is called
Logical gates.
Since a logic gate is a switching circuit (i.e. a digital circuit), its outputs can have only
one of the two possible states viz. either a high voltage (1) or a low voltage (0) - it is
either ON or OFF. Whether the output voltage of logic gate is high (1) or low (0) will
depend upon the condition at its input. Fig. shows the basic idea of a logic gate using
switches.
show the conditions at the input and output of a logic gate in the binary form as
shown in the table above. Such a table is calls truth table.
The term "logic" is usually used to refer to a decision-making process. A logic gate
makes logic decision regarding the existence of output depending upon the nature of
the input. Hence such circuits are called logic circuit.
AND Gate
The AND gate is a logic gate that has two or more inputs but only one output.
However, the output Y of an AND gates is HIGH when all inputs are HIGH. The
output Y of an AND gate is LOW if any or all the inputs are LOW.
It is called AND gate because the output is high only when all the inputs are high.
For this reason, the AND gate is sometimes called "any or nothing gate". For
example, consider a 2-input AND gate. The output y will be high when both the input
are high.
AND gate Operation : Fig (a) shown one way to build a 2-inputs AND gate while Fig
(b) shows its simplified schematic diagram. There are only four input-output
possibilities.
(I) When both A and B are connected to ground, both diodes (D1 and D2) are forward
biased and hence they conduct current. Consequently, the two diodes are grounded
and output voltage is zero. In terms of binary, when A = 0 and B = 0, then Y = 0 as
shows in the truth table.
(II) When A is connected to ground and B connected to the positive terminal of the
battery, diode D1 is forward biased and diode D2 will not conduct. Therefore diode D1
conducts and is grounded. Again output voltage will be zero. In terms of binary,
When A = 0 and B = 1,then Y = 0 as shows in the truth table. (III) When both B is
connected to the ground and A connected to the positive terminal of the battery, the
roles of diodes are interchanged. Now diode D2 will conduct while diode D1 dose not
conduct. As a result, diode D2 is grounded and again output voltage is zero. In binary
terms when A = 1 and B = 0 then Y = 0 as shows in the truth table.
(IV) When both A and B are connected to the positive terminal of the battery, both
diodes don't conduct. Now, the output voltage is +5V because there is no current
through RL.
It is clear from the truth table that for AND gate, the output is high if all the input are
high. However, the output is low if any or all input are low. Fig (c) shows the logic
symbol of the AND gate. This is the symbol you will memories and use from now on
for AND gates.
A B Y
0 0 0
0 1 0
1 0 0
1 1 1
Truth Table
A.B=Y
where the multiplication " . (dot)" stands for the AND operation. The adjoining table
shows the possible for the inputs. The table tells us 0 AND with any variable equals
0.1 AND with 1 equals one. The And function can be summed up as under:
A.B Y
0 AND with 0 equals 0
0.0 0 0 AND with 1 equals 0
0.1 0 1 AND with 1 equals 1
1.0 0
1.1 1
Fig (c) Adjoining table
OR Gate
An OR gate is a logic gate that has two or more inputs but only one output. However,
the output Y of an OR gates is LOW when all inputs are LOW. The output Y of an
OR gate is HIGH if any or all the inputs are HIGH.
It is called OR gate because the output is high if any or all the inputs are high. For
the same reason, an OR gate is sometimes called "any or all gate". For example,
consider a 2-input OR gate. The output y will be high if either or both input are high.
OR gate Operation: Fig (a) shown one way to build a 2-inputs OR gate while Fig (b)
shows its simplified schematic diagram. The input voltage are labelled as A and B
corresponds to 0 state (LOW level). The positive terminal of the battery (+5V)
corresponds to 1 state HIGH level). There are only four input-output possibilities.
(I) When both A and B are connected to ground, both diodes are non-conducting.
Hence the output voltage is ideally zero (lo voltage). In terms of binary, when A = 0
and B = 0, then Y = 0 as shows in the truth table.
(II) When A is connected to ground and B connected to the positive terminal of the
battery, diode D2 is forward biased and diode D1 is non-conducting. Therefore diode
D2 conducts and the output voltage is ideally +5V. In terms of binary, When A = 0
and B = 1, then Y = 1 as shows in the truth table.
(III) When both A and B are connected to the positive terminal of the battery and B to
the ground, diode D1 is on and diode D2 is off. Again the output voltage is +5V. In
binary terms when A = 1 and B = 0 then Y = 1 as shows in the truth table.
(IV) When both A and B are connected to the positive terminal of the battery, both
diodes are on. Since the diodes are in parallel, the output voltage is +5V. In binary
terms, when A = 1 and B = 1 ,then Y = 1 as shows in the truth table.
A B Y
0 0 0
0 1 1
1 0 1
1 1 1
Truth Table
IT is clear from the truth table that for OR gate, the output is high if any or all of the
inputs are high. The only way to get a low output is by having all inputs low. Fig (C)
shows the logical symbol of OR gate. Note that the symbol has curved line at the
input.
Fig (c)
A+ Y
B
0+0 0
0+1 1
1+0 1
1+1 1
Adjoining table
The adjoining table shows possibilities for the inputs. According to this table, when 0
is OR with 0 , the result equals 0. Also, any variable OR with 1 equals 1.The OR
function can be summed up as under:
0 OR with 0 equals 0
0 OR with 1 equals 1
1 OR with 1 equals 1
The NOT gate or Inverter is the simplest of all logic gates. It has only one input one
output. Where the output Y opposite of the input. The NOT gate is often called
inverter because it inverts the input.
Fig (b)
Fig (a)
Fig (a) shows a typical inverter circuit. When A is connected to ground, the base of
transistor Q1 will become negative. The negative potential cause the transistor to cut
off and large positive voltage is applied at A, the base of the transistor will become
positive, causing the transistor to conduct heavily. Therefore, the output voltage is
zero. In binary terms, when A = 1, Y = 0. as shows truth table for an inverter. It is
clear from the truth table that whatever the input to the inverter, the output assumes
opposite polarity. If the input is 0, the output will be 1: if the input is 1,the output will
be 0.
A Y
0 1
1 0
Truth Table
Fig (b) shows the logic symbol for NOT gate or inverter. Note that small bubble on
the inverter symbol represents inversion. The Boolean expression for NOT function
is
Y=
The OR, AND and NOT gates are the three basic circuits that make up all digital
circuits. We shall discuss a few combinations of these basic circuits.
(I) NAND Gate: It is combination of AND gate is connected to the input of a NOT
gate as shown in Fig. (a). Clearly, the output of a NAND gate is opposite to the AND
gate. This is illustrated in the truth table for the NAND gate. Note that truth table for
NAND gate is developed by inverting the output of the AND gate.
The Boolean expression for NAND function is
(II) NOR Gate: It is a combination of OR gate and NOT gate. In other words, output
of OR gate is connected to the input of a NOT gate as shown in Fig. (c). Note that
output of OR gate is inverted to form NOR gate. This is illustrated in the truth table
for NOR gate. It is clear that truth table for NOR gate is developed by inverting the
outputs of the OR gate.
Exclusive OR Gate
The name exclusive OR Gate is usually shortened to XOR gate. The XOR gate can
be obtained by using OR, AND and NOT gates as shown in Fig (a).
Shows the truth table for XOR gate. The table shows that the output is HIGH (1) if
any but not all of the inputs are High (1).This exclusive feature eliminates the
similarly to the OR gate. The OR gate truth table is also given so that you can
compare the OR gate truth table with XOR gate truth table. The logic symbol for
XOR gate is shown in Fig. (b). Note that the symbol is similar to that of OR gate
except for the additional curved line at the input side.