Digital Electronic Principles
Logic Gates
and
1 Boolean Algebra
Lecture #3 Logic Gates and Boolean Algebra
2 Logic Gates and Boolean Algebra
Logic Gates
– Inverter, OR, AND, Buffer, NOR, NAND, XOR, XNOR
Universal Gates
– NAND and NOR
Boolean Theorem
– Commutative, Associative, Distributive
– Basic Rules
DE Morgan's Theorem
Canonical/Standard Forms of Logic
– Sum of Product (SOP)
– Product of Sum (POS)
– Minterm and Maxterm
Lecture #3 Logic Gates and Boolean Algebra
3 Boolean Values
Earlier, we used electrical voltages to represent two
discrete values 1 and 0, from which binary numbers can
be formed
It’s also possible to think of voltages as representing two
logical values, true and false.
For simplicity, we often still write digits instead:
– 1 (high) is true
– 0 (low) is false
We will use these values 1 and 0 as the elements of our
Boolean System.
Lecture #3 Logic Gates and Boolean Algebra
4
Basic Boolean Operations
There are three basic operations for logical values.
Operation: AND (product) of two inputs OR (sum) of two inputs NOT (Complement)
Expression: XY, or X•Y X+Y Z = X'
Truth Table: X Y XY X Y X+Y X Z = X'
0 0 0 0 0 0 0 1
0 1 0 0 1 1 1 0
1 0 0 1 0 1
1 1 1 1 1 1
Lecture #3 Logic Gates and Boolean Algebra
5 Inverter/ Not Gate
Logic Symbol and Truth Table
– Here, Z is only TRUE if X is FALSE
– Circle (or ‘bubble’) on the output of a gate implies that it as an inverting (or
complemented) output
X Z = X'
Truth Table
X Z = X'
0 1
1 0
Lecture #3 Logic Gates and Boolean Algebra
6 Buffer
Logic Symbol and Truth Table
How to design buffers? Clue: NOT gates
X Z=X X X' Z=X
What is the use of buffers?
Truth Table
Refresh weak signals
X Z=X
Purposely put delays
0 0
1 1
Lecture #3 Logic Gates and Boolean Algebra
7 OR Gate
Logic Symbol and Truth Table
– Here, Z is TRUE if either X or Y is TRUE (or both are TRUE)
– In Boolean algebra OR is represented by a plus sign +
X Y Z=X+Y
0 0 0
0 1 1
1 0 1
1 1 1
Lecture #3 Logic Gates and Boolean Algebra
8 AND Gate
Logic Symbol and Truth Table
– Here, Z is only TRUE only if both X and Y are TRUE
– In Boolean algebra AND is represented by a dot .
X Y Z=X•Y
0 0 0
0 1 0
1 0 0
1 1 1
Lecture #3 Logic Gates and Boolean Algebra
9 NOT OR (NOR) Gate
Z is TRUE only if both X and Y are FALSE
– [or can also be stated as]; Z is FALSE if either X or Y is TRUE
(or both are TRUE)
X Y Z = (X + Y)'
0 0 1
0 1 0
1 0 0
1 1 0
Lecture #3 Logic Gates and Boolean Algebra
10 NOR Gate Cont.…
How to make NOR gate using basic gates?
Z = (X + Y)'
Lecture #3 Logic Gates and Boolean Algebra
11 NOT AND (NAND) Gate
Here, Z is TRUE if X is FALSE or Y is FALSE (or both are
FALSE)
– [or can be stated as] Y is FALSE only if both X and Y are TRUE
X Y Z = (X•Y)'
0 0 1
0 1 1
1 0 1
1 1 0
Lecture #3 Logic Gates and Boolean Algebra
12 NAND Gate Cont.…
How to make NAND gate using basic gates?
Z = (X•Y)'
Lecture #3 Logic Gates and Boolean Algebra
13 EXCLUSIVE OR (XOR) Gate
Here, Z is TRUE if either X or Y is TRUE (but not both)
i.e., Z is only TRUE when exactly one of the inputs (X or Y) is True
In Boolean algebra XOR is represented by an sign
X Y Z=X Y
0 0 0
0 1 1
1 0 1
1 1 0
Lecture #3 Logic Gates and Boolean Algebra
14 XOR Gate (Cont.…)
How to make XOR using basic gates (AND, OR, NOT)?
Z=X Y
Z = X•Y' + X'•Y
Lecture #3 Logic Gates and Boolean Algebra
15 EXCLUSIVE NOR (XNOR)
Here, Z is TRUE only if both X and Y are equal
i.e., if both X and Y are 0 or 1
X Y Z = (X Y)'
0 0 1
0 1 0
1 0 0
1 1 1
Lecture #3 Logic Gates and Boolean Algebra
16 XNOR Gate (Cont.…)
How to make XNOR using basic gates (AND, OR, NOT)?
Z = (X Y)'
Z = (X•Y' + X'•Y)'
Lecture #3 Logic Gates and Boolean Algebra
17
Axiomatic Definition of Boolean Algebra
A Boolean algebra requires
– A set of elements B, consisting of two elements (0 and 1)
– Two binary operations OR and AND
– The axioms below must always be true
Lecture #3 Logic Gates and Boolean Algebra
18 Basic Theorems of Boolean Algebra
In addition to the axioms, additional laws can be derived; they are
called theorems of Boolean Algebra
These theorems are useful in performing algebraic manipulations of
Boolean expressions
1. x+x=x x•x=x Idempotency
2. x+1=1 x•0=0 Null Elements
3. yx + x = x (y + x) • x = x Absorption (Covering)
4. (x')' = x Involution
5. x + (y + z) = (x + y) + z x(yz) = (xy)z Associative
6. x + x'y = x + y x • (x' + y) = x • y Simplification
7. (x + y)' = x'y' (xy)' = x' + y' DeMorgan’s
Lecture #3 Logic Gates and Boolean Algebra
19 Duality Principle
*** Critically analyse this: ***
The left and right columns of axioms are duals
– exchange all ANDs with ORs, and 0s with 1s
d
Lecture #3 Logic Gates and Boolean Algebra
20 Proofing the Theorems using Axioms
Idempotency: x+x=x
Proof:
x + x = (x + x) • 1 by identity
= (x + x) • (x + x') by complement
= x + x • x' by distributivity
=x+0 by complement
=x by identity
Idempotency: x•x=x
Proof:
x • x = (x • x) + 0 by identity
= (x • x) + (x • x') by complement
= x • (x + x') by distributivity
=x•1 by complement
=x by identity
Lecture #3 Logic Gates and Boolean Algebra
21 Boolean Simplification - Example
Using Boolean Theorem, Simplify the expression:
AB + A(B + C) + B(B + C)
– Apply distributive law,
AB + AB + AC + BB + BC
– Apply the Idempotency rule (BB = B), and the from same rule also (AB + AB = AB)
AB + AC + B + BC
– Apply the Absorption/ Covering rule (B + BC = B)
AB + AC + B
– Invoking again the Absorption/ Covering rule (AB + B = B)
B + AC
– At this point, the expression is simplified as much as possible
Lecture #3 Logic Gates and Boolean Algebra
22 Boolean Simplification – Example Cont.…
Original expression is AB + A(B + C) + B(B + C)
Which is logically equal to B + AC
Lecture #3 Logic Gates and Boolean Algebra
23 Review Questions
Simplify the expressions below using Boolean Algebra
1. x = AB'D + A(BD)'
2. y = (A' + B )(A+B)
3. z = ACD + A'BCD
4. x = AC' + ABC‘
5. y = (AB)'CD' + (ABCD)'
6. z = A'D + ABD
7. x = (A'+B'+C').(A'+B+C').(A+B'+C')
8. y = A'.B.C + A.B'.C + A.B.C
Lecture #3 Logic Gates and Boolean Algebra
24 DeMorgan’s Theorem
States that: The complement of a product (AND) of variables is equal
to the sum (OR) of the complemented variables
– Theorem 1
(AB)' = A' + B' A B (A • B)' A' + B'
0 0 1 1
0 1 1 1
1 0 1 1
1 1 0 0
Lecture #3 Logic Gates and Boolean Algebra
25 DeMorgan’s Theorem Cont.…
Also states that: The complement of a sum(OR) of variables is equal
to the product (AND) of the complemented variables
– Theorem 2
(A + B)' = A' • B' A B (A + B)' A' • B'
0 0 1 1
0 1 0 0
1 0 0 0
1 1 0 0
NOTE: In DeMorgan’s Theorem:
“Break the bar, change the operator”
Lecture #3 Logic Gates and Boolean Algebra
26 Universal Gates
NAND and NOR gates are known as Universal gates because all
logic gates can be represented by NAND and NOR
NAND and NOR are the cheapest and smallest to manufacture in
Integrated Circuits compared to AND and OR
NAND/NOR are faster than AND/OR
Therefore NAND and NOR are always used in practical circuit design
Lecture #3 Logic Gates and Boolean Algebra
27 NAND Universal Gates
How to represent inverter using NAND gates?
How to represent OR gate using NAND gates?
How to represent AND gate using NAND gates?
Lecture #3 Logic Gates and Boolean Algebra
28 NOR Universal Gates
The respective representations of the Inverter, OR gate and AND
gate using NOR gates will be as shown below
Lecture #3 Logic Gates and Boolean Algebra
29 Making NAND circuits
The easiest way to make a NAND circuit is to start with a regular, primitive
gate-based diagram.
Two-level circuits are trivial to convert, so here is a slightly more complex
random example
Lecture #3 Logic Gates and Boolean Algebra
30 Converting to a NAND circuit
Step 1: Convert all AND gates to NAND gates using AND-NOT symbols,
and convert all OR gates to NAND gates using NOT-OR symbols.
Lecture #3 Logic Gates and Boolean Algebra
31 Converting to NAND, concluded
Step 2: Make sure you added bubbles along lines in pairs ((x’)’ = x). If not,
then either add inverters or complement the input variables.
Lecture #3 Logic Gates and Boolean Algebra
32 Making NOR circuits
The NOR operation is the dual of the NAND.
NOR gates are also universal.
We can convert arbitrary circuits to NOR diagrams by following a procedure
similar to the one just shown below:
– Step 1:
Convert all OR gates to NOR gates (OR-NOT), and all AND gates to NOR
gates (NOT-AND).
– Step 2:
Make sure that you added bubbles along lines in pairs. If not, then either
add inverters or complement input variables.
Lecture #3 Logic Gates and Boolean Algebra
33 Why is it called Boolean Algebra?
Brief History…
It was invented by George Boole , way back in the 1850s!!
Its an algebraic description for processes involving logical thought and reasoning
In 1937, Claude Shannon got the idea to apply Boolean Algebra to circuit
design. This and many other things made Shannon so darm ….rich
and sooo ….famous that he retired at 50!
Switching circuits are circuits built from devices that switch between
two states (e.g. 0 or 1, ON or OFF, TRUE or FALSE …).
Switching Algebra is a special case of Boolean Algebra in which all
variables take on just two distinct values
Boolean Algebra is a powerful tool for analyzing and designing logic circuits.
Lecture #3 Logic Gates and Boolean Algebra
34 Importance of Boolean Algebra
Boolean Algebra is used to simplify Boolean expressions.
– Through application of the Laws and Theorems discussed
Simpler expressions lead to simpler circuit realization,
which, generally, reduces cost, area requirements, and
power consumption.
The objective of the digital circuit designer is to design and
realize optimal digital circuits.
Lecture #3 Logic Gates and Boolean Algebra
35 Algebraic Simplification
Justification for simplifying Boolean expressions:
– Reduces the cost associated with realizing the expression using logic gates.
– Reduces the area (i.e. silicon) required to fabricate the switching function.
– Reduces the power consumption of the circuit.
– Faster switching circuits.
In general, there is no easy way to determine when a
Boolean expression has been simplified to a minimum
number of terms or minimum number of literals
– No unique solution
Lecture #3 Logic Gates and Boolean Algebra
36 Algebraic Simplification
Boolean (or Switching) expressions can be simplified using
the following methods:
1.Multiplying out the expression
2.Factoring the expression
3.Combining terms of the expression
4.Eliminating terms in the expression
5.Eliminating literals in the expression
6.Adding redundant terms to the expression
As we shall see, there are other tools that can be used to
simplify Boolean Expressions. Namely, Karnaugh Maps.
Lecture #3 Logic Gates and Boolean Algebra
37 Summary on Rules of Boolean Algebra
Lecture #3 Logic Gates and Boolean Algebra
38 Summary on Rules of Boolean Algebra
Lecture #3 Logic Gates and Boolean Algebra
39 Summary on Rules of Boolean Algebra
Lecture #3 Logic Gates and Boolean Algebra