Basic Logic Gates
Logic gates are an important concept if you
are studying electronics. These are important
digital devices that are mainly based on the
Boolean function. Logic gates are used to carry
out logical operations on single or multiple
binary inputs and give one binary output. In
simple terms, logic gates are the electronic
circuits in a digital system.
1
Basic logic gates
Not
And
Or
Xor
Nand
Nor
2
2
NOT Gate
A NOT gate accepts one input signal (0 or 1) and returns
the opposite signal as output
Various representations of a NOT gate
3
AND Gate
An AND gate accepts two input signals. If both are 1,
the output is 1; otherwise, the output is 0
Various representations of an AND gate
4
OR Gate
An OR gate accepts two input signals. If both are 0, the
output is 0; otherwise, the output is 1
Various representations of a OR gate
5
XOR Gate
An XOR gate accepts two input signals. If both are the
same, the output is 0; otherwise, the output is 1
Various representations of an XOR gate
Note the difference between the XOR gate and the OR gate; they differ only in
one input situation. When both input signals are 1, the OR gate produces a 1
and the XOR produces a 0
XOR is called the exclusive OR
6
NAND Gate
The NAND gate accepts two input signals. If both are 1,
the output is 0; otherwise, the output is 1
Various representations of a NAND gate
7
NOR Gate
The NOR gate accepts two input signals. If both
are 0, the output is 1; otherwise, the output is 0
Various representations of a NOR gate
8
Review of Gate Processing
A NOT gate inverts its single input
An AND gate produces 1 if both input values are 1
An OR gate produces 0 if both input values are 0
An XOR gate produces 0 if input values are the same
A NAND gate produces 0 if both inputs are 1
A NOR gate produces a 1 if both inputs are 0
9
UNIVERSAL GATE
NAND
Because gates are manufactured in IC form, typically
containing two to six gates of the same type, it is often
uneconomical to use a complete IC of six gates to perform a
particular logic function. A better solution may be to use just a
single type of gate to perform any of the logic operations
required. Two types of gate, NAND and NOR are often used
to perform the functions of any of the other standard gates, by
connecting a number of either of these ‘universal’ gates in a
combinational circuit. Although it may not seem efficient to
use several universal gates to perform the function of a single
gate, if there are a number of unused gates in one or more
NAND and NOR ICs, these can be used to perform other
functions such as AND or OR rather than using extra ICs to
perform that function. This technique is especially useful in
the design of complex ICs where whole circuits within the IC
can be fabricated using a single type of gate. 11
12
Universal Gate – NAND
This presentation will demonstrate
• The basic function of the NAND gate.
• How a NAND gate can be used to replace an AND gate, an OR
gate, or an INVERTER gate.
• How a logic circuit implemented with AOI logic gates can be
re-implemented using only NAND gates.
• That using a single gate type, in this case NAND, will reduce
the number of integrated circuits (IC) required to implement a
logic circuit.
13
NAND Gate as an Inverter Gate
(Before Bubble)
X Z
0 1
Equivalent to Inverter
1 0
14
NAND Gate as an AND Gate
X
Y
NAND Gate Inverter
X Y Z
0 0 0
0 1 0
1 0 0 Equivalent to AND Gate
1 1 1
15
NAND Gate as an OR Gate
Inverters NAND Gate
X Y Z
0 0 0
0 1 1
1 0 1 Equivalent to OR Gate
1 1 1
16
NAND Gate as an XOR Gate
Z=XY+XY
Equivalent to XOR Gate
17
NAND Gate Equivalent to AOI
Gates
AND OR INVERTER
18
Process for NAND Implementation
1. If starting from a logic expression, implement the design with
AOI logic.
2. In the AOI implementation, identify and replace every
AND,OR, and INVERTER gate with its NAND equivalent.
3. Redraw the circuit.
4. Identify and eliminate any double inversions (i.e., back-to-
back inverters).
5. Redraw the final circuit.
19
NAND Implementation
Example:
Design a NAND Logic Circuit that is equivalent to the AOI circuit
shown below.
20
NAND Implementation
Solution – Step 2
Identify and replace every AND,OR, and INVERTER gate with its
NAND equivalent.
21
NAND Implementation
Solution – Step 3
Redraw the circuit.
22
NAND Implementation
Solution – Step 4
Identify and eliminate any double inversions.
23
NAND Implementation
Solution – Step 5
Redraw the circuit.
24
Proof of Equivalence
25
AOI vs. NAND
IC Type Gates Gate / IC # ICs IC Type Gates Gate / IC # ICs
74LS04 1 6 1 74LS00 4 4 1
74LS08 2 4 1 Total Number of ICs → 1
74LS32 1 4 1
Total Number of ICs → 3
26