Lecture 6 (Complements NAND NORImplementation)
Lecture 6 (Complements NAND NORImplementation)
2
DeMorgan’s Laws
DeMorgan’s Laws state that
3
Complement of an Expression
Complement of any expression can be obtained by repeatedly
applying DeMorgan’s laws or following the rules:
1. Complement each variable (that is, a to a’ or a’ to a).
2. Replace 0 by 1 and 1 by 0.
3. Replace AND by OR and OR by AND, being sure to preserve the
order of operations. It sometimes requires additional parentheses.
Note:
If the function is in SOP form, its complement will be in POS form and
the complement of a POS expression will be an SOP one.
4
Example
Consider the expression:
5
Converting Truth Tables into
Algebraic Expressions
Sometimes, we need to
convert truth tables into
algebraic expressions and
vice versa.
In order to understand the
process of converting
truth table into algebraic
expression, consider the
two-variable truth table of
Table 2.11.
6
Converting Truth Tables into
Algebraic Expressions(Contd...)
From the table, we see that:
• f is 1 if a = 0 AND b = 1 OR
if a’= 1 AND b = 0 OR
if a = 1 AND b = 1
7
Explanation
• Each row of the truth table corresponds to a product term.
• An SOP expression is formed by ORing those product terms
that correspond to the rows of the truth table for which the
function is 1.
• Each product term has each variable included, with that
variable complemented when the entry in the input column for
Following table shows minterms and minterm numbers that are used for all
functions of three variables: A, B and C.
For a specific function, those terms
for which the function is 1 are
used to form an SOP expression
for f, and those terms for which the
function is 0 are used to form an
SOP expression for f ’ . We can
then complement f ’ to form a POS
expression for f.
9
Example
Consider the following truth table
showing both the function f and its
complement f ’.
We can write:
10
Example (Contd...)
From implementation point of view, the sum of minterms
and product of maxterms expressions are not suitable.
So, we need to reduce the functions into minimum terms
and literals.
Thus, we can reduce the above function, given in sum of
minterms, into minimum numbers of terms and literals as:
11
General Approach to Switching Functions
For ‘n’ variables, we can have 22n different switching functions.
So, for two variables, there are 16 possible truth tables, resulting in
16 different functions.
The truth table of Table 2.13 shows all of these functions.
12
General Approach to Switching Functions (Contd...)
Note:
13
NAND Gates
The truth table for
NAND (Not AND)
gate is as follows:
14
NOR Gates
The truth table for NOR
(Not OR) gate is as
follows:
15
Why we use NAND and NOR gates?
The most important reason is that with either NAND or NOR, only one type
of gate is required. On the other hand, both AND and OR gates are required;
and, often, NOT gates are needed, as well.
The following circuits represent the behavior of NOT, AND and OR gates,
using only NAND gates.
16
Example (Circuit using only NAND gates)
• Consider the expression:
17
NAND Implementation
Thus, if we have to implement a circuit using only NAND
gates, the function should be in Sum of Product (SOP) form.
Pass every AND term, through a separate NAND gate.
Add one NAND gate at the end and pass all the outputs of
previous NAND gates, as an input to this NAND gate.
Any term which involves only one literal, will be
complemented and passed directly to the last NAND gate as
its input.
18
Converting NAND Implementation Into AND-OR Implementation
If we use the alternate symbol for the last NAND gate, we get the
following figure.
19
Example
• Consider the following function:
20
Explanation
Pass the AND term i.e. xz through the NAND gate at first
level.
Use the alternate symbol of NAND gate when the terms are
ORed e.g. in this case xz + w’, at the second level.
Use the alternate symbol of NAND gate at the last level
when all terms need to be ORed.
See how the single literal terms have been complemented
before passing through the gates.
21
Example
• Consider the following function:
22
Example (Contd...)
23
NOR Implementation
In order to implement a circuit using only NOR gate, the function
should be in Product of Sum (POS) form.
When this function is directly implemented using AND-OR gates, we
use OR gates at the first level and one AND gate at the second level.
To get NOR implementation, we use the following rules:
1. The final output of the circuit comes from an AND gate.
2. The inputs to OR gates come either from a system input or from the
output of an AND gate, and
3. The inputs to AND gates come either from a system input or from
the output of an OR gate.
Then all gates can be converted to NOR gates, and, if an input comes
directly into an AND gate, that input must be complemented.
24
Example
Consider the following function:
The bubbles connecting the same line cancel each other. So,
as a result we can get the simple AND-OR logic diagram.
25