Di it l L
Digital Logic
i Ci
Circuits
it
Dr. Jaydeb Bhaumik
Associate Professor
Dept of ETCE
Dept.
Jadavpur University
Outline of Presentation
Revision of Boolean algebra
Revision of DeMorgan’s Theorem and consensus Theorem
Shannon’s expansion Theorem
Canonical
C i l representations:
t ti minterm
i t and
d maxterm
t
Standard Forms
Karnaugh map simplification
Quin-Maclusky minimization
2
Postulates and Theorems of Boolean Algebra
Duality principle states that every algebraic expression deducible from the
postulates of Boolean algebra remains valid if the operators and identity elements
are interchanged. If the dual of an algebraic expression is desired, we simply
i t h
interchange OR andd AND operators
t and d replace
l 1’ by
1’s b 0’s
0’ andd 0’s
0’ by
b 1’s.
1’
3
Associative and Distributive Property
Associative
A i i property off addition
ddi i isi given
i by
b
A+(B+C) = (A+B)+C
Associative property of multiplication is given by
A.(B.C) = (A.B).C
Boolean addition is distributive over Boolean multiplication, given by
A+ BC = A.1 + BC
= A.(1+B) + BC
= A.1 + AB + BC
= A.(1+C)
A (1+C) + AB + BC
= A.1 + AC + AB + BC
= A.A + AC + AB + BC
= A(A
A(A+C)C) + B (A+C)
(A C)
= (A+B)(A+C)
Boolean multiplication is also distributive over Boolean addition given by
A.(B+C) = A.B + A.C
4
Cont.
Basic laws (theorems) of Boolean algebra can be proved easily by adopting
the truth table method or by using algebraic manipulation.
Absorption laws: A + AB =A; A. (A+B) = A
A+ A’B = A+B; A. (A’+B)
i) A+ AB = A.1 + AB = A (1+B) = A.1 = A
ii) A (A+B) = A.A
A. A A + A.B
A B (Boolean multiplication is distributive)
= A + AB = A
iii) A+ A
A’B
B = (A+A
(A+A’)(A+B)
)(A+B) (Boolean addition is distributive)
= 1. (A+B) = A+B
iv) A.
A (A
(A’+B)
+B) = A.
A AA’+
+ A.B
A B = AB
5
Consensus Theorem
• AB+A'C+BC = AB + A'C
• (A+B)(A'+C)(B+C) =(A+B)(A’+C)
Proof:
i) AB+A'C+BC = AB+A'C+BC.1
= AB + A'C + BC(A+A‘)
= AB + A'C + ABC + A‘BC
= AB (1+C) + A’C ( 1+B)
= AB + A'C
ii) (A+B)(A'+C)(B+C) = (A+B)(A'+C)(B+C+0)
= (A+B)(A'+C)(B+C+AA’)
(A+B)(A +C)(B+C+AA )
= (A+B)(A'+C)(B+C+A) (B+C+A’)
= (A+B)(A+ B+C) (A'+C)(A’ + C+B)
= (A+B)
(A B) (A'
(A'+C)
C)
6
DeMorgan’s Theorem
Two theorems that are an important part of Boolean algebra were proposed
by DeMorgan.
The first theorem states that the complement of a product is equal to the
sum of the complements.
(ABC N)’ = A’ + B’ + C’ + … + N’
(ABC…N)’
The second theorem states that , the complement of a sum is equal to the
product of the complements.
(A+B+C+ … + N)’ = A’. B’ . C’ …N’
7
Shannon’s Expansion
• Shannon’s expansion assumes a switching algebra system
• Divide a switching function into smaller functions
• Pick a variable x, partition the switching function into two cases: x=1 and
x 0
x=0
f(x, y, z,…)= xf(x=1, y, z,…) + x’f(x=0, y, z,…)
• For example
f(x) = xf(1)
xf(1)+x’f(0)
x f(0)
f(x, y) = xf(1,y)+x’f(0,y)
8
Cont.
9
Cont.
• Shannon’s expansion and consensus theorem are used for logic optimization
• Shannon’ss expansion divides the problem into smaller functions
Shannon
• Consensus theorem merges common terms to obtain simplified logic
expressions
10
Needs of most simplified expression
The simplest
Th i l t form
f off an expression
i isi the
th one that
th t has
h the
th minimum
i i number
b
of terms with the least number of literals (variables) in each term. Literal is a
single variable within a term that may be complemented or uncomplemented
form.
By simplifying an expression to the one that uses the minimum number of
terms, we ensure that the function will be implemented with the minimum
number of gates.
By simplifying an expression to the one that uses the least number of literals
f each
for h terms, we ensure that
h the
h function
f i willill be
b implemented
i l d with
i h gates that
h
have the minimum number of inputs.
Simplification
Si lifi ti off logic
l i expression
i using
i B l
Boolean algebra
l b is i nott suitable
it bl
because:
it lacks specific rules to predict the most suitable next step in the simplification process
it is difficult to determine whether the simplest
p form has been achieved.
11
Two-Valued Boolean Algebra
• Two-Valued Boolean Algebra- Boolean algebra with only two elements {0, 1}
• Th operator
The t tables
t bl for
f the
th Boolean
B l operators
t + andd * are shown
h below
b l
12
Operator Precedence
• The operator precedence
Th d for
f evaluating
l i expressions
i is
i parentheses,
h NOT,
NOT
AND, OR.
• In other words, expressions inside parentheses must be evaluated before
all other operations. The next operation that holds precedence is the
complement and then following the AND and finally OR.
13
Logic Function Implementation
• Using Switches
– For inputs:
Switches in parallel => OR
• logic 1 is switch closed
• logic 0 is switch open
– For outputs:
• logic 1 is light on
• logic 0 is light off.
– NOT uses a switch such
that: Switches in series => AND
• logic 1 is switch open
• logic 0 is switch closed
Normally-closed switch => NOT
C
14
Logic Function Implementation (Continued)
• Example: Logic Using Switches
B C
A
Light is on (L = 1) for
L(A, B, C, D) = A ((B C') + D) = A B C' + A D
and off (L = 0), otherwise.
15
Logic Gates
• In the earliest computers, switches were opened and closed by magnetic
fields produced by energizing coils in relays. The switches in turn opened
and closed the current paths.
• Later, vacuum tubes that open and close current paths electronically
replaced relays.
• Today, transistors are used as electronic switches that open and close
current paths.
16
Truth Tables for the 16 Functions of Two Binary Variables
For a n-variable function , number of input combinations 2n . For each
input combination
n
output can be either 0 or 1. So number of possible
f ti
functions 22
17
Boolean Expressions for the 16 Functions of Two
Variables
18
Digital Logic Gates
19
Cont.
20
Definition of Different Logic Gates
OR Gate: An OR gate has two or more inputs but only one output and the
output of an OR gate attains the state 1 if one or more of the inputs are in the
state 1.
AND Gate: An AND gate has two or more inputs but only one output and the
output of an AND gate attains the state 1 if and only if all the inputs are in the
state 1.
NOT Gate: A NOT gate has one input and one output. The output of a NOT
gate assume the state 1 if and only if, the input does not assume the state 1.
NOR Gate: A NOT gate follows a OR gate is called a NOT-OR, or simply
NOR gate. A NOR gate has two or more inputs but only one output and the
output
p of a NOR g
gate attains the state 1 if and only
y if all the inputs
p are in the
state 0.
21
Cont.
NAND Gate: A NOT gate follows a AND gate is called a NOT-AND, or
Simply NAND gate. A NAND gate has two or more inputs but only one
output and the output of a NAND gate attains the state 1 if one or more of the
Inputs are in the state 0.
XOR Gate: The h EXCLUSIVE-OR gate, iis alsol called
ll d the
h XOR gate. The h
output of a two inputs XOR gate will be in the state 1 if either input but not
both are in the state 1. Y=
XNOR Gate: The EXCLUSIVE-NOR gate is also called the XNOR gate or
equivalence gate.
gate The output of two inputs XNOR gate will be in logic level 1
when both inputs are in same logic level.
Y=A B
22
Logic Gates with more than two inputs
3-Input AND Gate 4-Input AND Gate 4-Input OR Gate
3-Input OR Gate
23
Boolean Functions
Boolean algebra is an algebra that deals with binary variables and logic
operations. A Boolean function described by an algebraic expression
consists of binary variables, the constants 0 and 1, and the logic operation
symbols. For a given value of the binary variables, the function can be
equal to either 1 or 0.
A Boolean function can be represented in a truth table. The number of
rows in the truth table is 2n, where n is the number of variables in the
function. The binary combinations for the truth table are obtained from the
binary numbers by counting from 0 through 2n - 1.
A Boolean function can be transformed from an algebraic expression into a
circuit diagram composed of logic gates connected in a particular structure.
The logical circuit diagram is also called a schematic.
24
Truth table
Truth table: a tabular listing of the values of a function for all possible
combinations of values on its arguments.
Truth table: a unique representation of a Boolean function
If two functions have identical truth tables, the functions are equivalent
(and vice-versa).
Truth tables can be used to prove equality theorems.
However, the size of a truth table grows exponentially with the number of
variables involved, hence unwieldy. This motivates the use of Boolean
Algebra.
25
Cont.
x y z y’z x+y’z
0 0 0 0 0 Boolean function
0 0 1 1 1
F1 = x + y´z
0 1 0 0 0
0 1 1 0 0
1 0 0 0 1
1 0 1 1 1
1 1 0 0 1
1 1 1 0 1
26
Gate Level Implementation
In logical circuit diagrams, the variables of the function are taken as the inputs
of the circuit and the binary variable F1 is taken as the output of the circuit.
circuit
The schematic expresses the relationship between the output of the circuit and its
inputs.
p
We can construct any combinational circuit with AND, OR, and NOT gates
Additional logic gates are used for practical reasons
27
Gate Level Implementation of a Logic Expression
Logic Diagram with Gates
Logic Function A X
B
X = A + BC B
C BC
Logic Diagram with Gates
Logic Function A A+B
B
X = (A + B)C B X
C
28
Minterms and Maxterms
The product term which contains each of the n variables as factor in either
complemented or uncomplemented form is called a minterm, with each
variable being primed if the corresponding bit of the binary number is 0 and
unprimed if a 1.
A Boolean function can be expressed algebraically from a given truth table
by forming a minterm for each combination of the variables that produces a
1 in
i the
th function
f ti and d then
th taking
t ki the
th OR off all
ll those
th t
terms.
A sum term containing all the n variables of the function in either
complemented or uncomplemented form is called a Maxterm,
Maxterm each maxterm
is obtained from an OR term of the n variables, with each variable being
unprimed if corresponding bit is a 0 and primed if a 1.
A Boolean function can be expressed algebraically from a given truth table
by forming a maxterm for each combination of the variables that produces a
0 in the function and then taking the AND of all those terms.
29
Minterms and Maxterms for Three Binary Variables
For a n-variable function, No. of minterms or standard products is 2n ; No. of
maxterms or standard
d d sums isi 2n
Boolean functions expressed as a sum of minterms or product of maxterms are
said to be in canonical form.
30
Function of Three Variables
31
Complement of a Boolean Function
Complement of a Boolean function can be obtained from the truth table
by forming a minterms for each combination that produces a 0 in the
function and then ORing those terms.
terms The complement of f1 is
( f1’)’ = ( )’
The expression can be obtained directly, form a maxterm for each
combination of the variables that produces a 0 in the function, and then form
the AND of all those maxterms.
32
Boolean function in its sum of minterms form
• Example: Express the Boolean function F = A+ B'C as a sum of minterms.
The function has three variables: A, B, and C. The first term A is missing
two variables (B and C);
33
Cont.
An alternative procedure for deriving the minterms of a Boolean function is
to obtain the truth table of the function directly from the algebraic
expression and then read the minterms from the truth table.
From the truth table, we can then read the five minterms of the function
to be 1, 4, 5, 6, and 7.
34
Boolean function in its product of maxterms form
To express a Boolean function as a product of maxterms, it must first be
brought into a form of OR terms. This may be done by using the
di ib i law,
distributive l x + yz = (x
( + y)(x
)( + z).
) Then
Th any missing
i i variable
i bl ‘a’
‘ ’ in
i
each OR term is ORed with aa'.
35
Cont.
Conversion Steps for Product of maxterms
1. Examine each term in the given logical function. Retain it if it is a
maxterm.
2. Check for variables that are missing in each OR terms which is not a
maxterm. Add aa‘ to the OR term for each variable ‘a‘ that is missing.
3. Expand the expression using the distributive property and eliminate
the redundant terms.
36
Conversion between Canonical Forms
The last conversion follows from the definition of minterms and maxterms, i.e
37
Cont.
In general, to convert from one canonical
Since there is a total of eight
minterms or maxterms in a function
of three variables, we determine the
missing terms to be 0, 2, 4, and 5.
Th function
The f ti expressed d as a product
d t
of maxterms is
38
Standard Forms
The two canonical forms of Boolean algebra are basic forms that one
obtains from reading a given function from the truth table. These forms are
very seldom the ones with the least number of literals, because each
minterm or maxterm must contain, by definition, all the variables, either
complemented or uncomplemented.
Another way to express Boolean functions is in standard form. In this
configuration, the terms that form the function may contain one, two, or
any number of literals. There are two types of standard forms: the sum of
products and products of sums.
39
Cont.
The logic diagram of a sum‐of‐products expression consists of a group of
AND gates followed by a single OR gate. Each product term requires an
AND gate, except for a term with a single literal.
The logic sum is formed with an OR gate whose inputs are the outputs of
the AND gates and the single literal. It is assumed that the input variables
are directly available in their complements, so inverters are not included in
the diagram. This circuit configuration is referred to as a two‐level
implementation.
Two‐level implementation: Sum of Products 40
Cont.
A product of sums is a Boolean expression containing OR terms,
terms called
sum terms. Each term may have any number of literals. The product
denotes the ANDing of these terms. An example of a function expressed as
a product of sums is
Two‐level implementation: Product of Sums
This expression has three sum terms, with one, two, and three literals. The
product is an AND operation. The gate structure of the product‐of‐sums
expression
p consists of a g
groupp of OR g
gates for the sum terms ((except
p for a
single literal), followed by an AND gate
41
Cont.
A Boolean function may be expressed in a nonstandard form. For example,
the function F3 is neither in sum‐of‐products nor in product‐of‐sums form.
The implementation of this expression requires two AND gates and two OR
gates. There
Th are three
h l l off gating
levels i ini this
hi circuit.
i i It I can be
b changed
h d to a
standard form by using the distributive law.
In general, a two‐level implementation is preferred because it produces the
least amount of delay through the gates when the signal propagates from the
inputs to the output.
output However,
However the number of inputs to a given gate might
not be practical.
42
Universal Gates
• NAND or NOR gates are known as a “universal” gate because ANY digital circuit can
be implemented with NAND or NOR gates alone.
• To prove the above,
above it suffices to show that AND,
AND OR,
OR and NOT can be implemented
using NAND gates only.
.
43
Design of XOR and XNOR Gate using NAND Gates
44
Cont.
X Z = X
X+Y
X
Z= X+Y=X+Y
Y
NOR Gate “Inverter”
X Y
Z=X+Y=XY=XY
Y
“Inverters” NOR Gate
45
Design of XOR and XNOR Gate using NOR Gates
AB+
=A B
46