You are on page 1of 56

ECEG-3201 Digital Logic Design

Addis Ababa Institute of Technology


(AAIT) Department of Electrical and
Computer Engineering
Learning Outcomes

 At the end of the lecture, students should get


familiarized with:
 Basic logic functions
 Truth table & timing diagram
 Boolean algebra
 Boolean’s theorems
 De Morgan’s law
AAIT, Department of
Electrical and Computer 2 Nebyu Yonas Sutri
Engineering
Describing Logic Circuits

 Now that we understand the concept of


binary numbers, we will study ways of
describing how systems using binary logic
levels make decisions.
 Boolean algebra is an important tool in
describing, analyzing, designing, and
implementing digital circuits.

AAIT, Department of
Electrical and Computer 3 Nebyu Yonas Sutri
Engineering
Describing Logic Circuits

 Boolean Algebra is a mathematical tool that


allows us to describe the relationship
between a logic circuits outputs and its inputs
as an algebraic expression (Boolean
expression).
 Boolean algebra is an important tool in
describing, analyzing, designing, and
implementing digital circuits.

AAIT, Department of
Electrical and Computer 4 Nebyu Yonas Sutri
Engineering
Digital Logic Circuits

AAIT, Department of
Electrical and Computer 5 Nebyu Yonas Sutri
Engineering
Boolean Constants and Variables

 Boolean algebra allows only two values:


0 and 1.
 Logic 0 can be presented as: false, off, low,
no, open switch.
 Logic 1 can be presented as: true, on, high,
yes, closed switch.
 Three basic logic operations: OR, AND, and
NOT.

AAIT, Department of
Electrical and Computer 6 Nebyu Yonas Sutri
Engineering
Truth Tables
 A truth table describes the relationship
between the input and output of a logic
circuit.
 The number of entries corresponds to the
number of inputs.
 For example: 2 inputs system will give a truth
table with 22 = 4 entries. 3 inputs will have
23 = 8 entries.
 A N input table will have 2N entries.
AAIT, Department of
Electrical and Computer 7 Nebyu Yonas Sutri
Engineering
Truth Tables
 Examples of truth tables with 2, 3, and 4
inputs.

AAIT, Department of
Electrical and Computer 8 Nebyu Yonas Sutri
Engineering
The AND Gate
 Two or more inputs and single output
 Logical multiplication
 Logic Expression
 Symbol is dot :

 Z = X · Y
AND truth table
 Or no symbol

 Z = XY

 Logic Operation
 Output Z is 1 when all inputs are 1

 Output Z is 0 when at least one of


the inputs is 0

AAIT, Department of
Electrical and Computer 9 Nebyu Yonas Sutri
Engineering
The AND gate Timing Diagram

Timing Diagrams

AAIT, Department of
Electrical and Computer 10 Nebyu Yonas Sutri
Engineering
The AND gate Timing Diagram

Timing Diagram for an AND Gate


X= A when B=1

AAIT, Department of
Electrical and Computer 11 Nebyu Yonas Sutri
Engineering
The OR Gate

 Two or more inputs and one


output
 Logic expression
 Symbol is + , Not addition

 Z = X + Y

 Logic operation OR Truth Table


 Output Z is 1 when at least
one of the inputs is 1
 Output Z is 0 when all
inputs X, Y are 0
AAIT, Department of
Electrical and Computer 12 Nebyu Yonas Sutri
Engineering
OR Gate Timing diagrams

AAIT, Department of
Electrical and Computer 13 Nebyu Yonas Sutri
Engineering
OR Gate Timing diagrams

AAIT, Department of
Electrical and Computer 14 Nebyu Yonas Sutri
Engineering
OR Operation With OR Gates
 The OR operation is similar to addition but
when A = 1 and B = 1, the OR operation
produces 1 + 1 = 1.
 In the Boolean expression

X=1+1+1=1
We could say that:
X is true (1) when A is true (1) OR B is true (1)
OR C is true (1).

AAIT, Department of
Electrical and Computer 15 Nebyu Yonas Sutri
Engineering
OR Operation With OR Gates
 There are many examples of applications
where an output function is desired when one
of multiple inputs is activated.

AAIT, Department of
Electrical and Computer 16 Nebyu Yonas Sutri
Engineering
The NOT gate
 The Boolean expression for
the NOT operation is

XA
 This is read as:
 X equals NOT A, or INVERTER Truth Table
 X equals the inverse of A, or
 X equals the complement of A

AAIT, Department of
Electrical and Computer 17 Nebyu Yonas Sutri
Engineering
Inverter Timing diagrams

AAIT, Department of
Electrical and Computer 18 Nebyu Yonas Sutri
Engineering
More than 2 inputs

 Work the same way


 What’s output?

What’s the output?


1 if all inputs are 1

What’s the output?


1 if at least one on the inputs is 1
AAIT, Department of
Electrical and Computer 19 Nebyu Yonas Sutri
Engineering
The NAND Gate
 A universal gate
 Used in combination to perform AND, OR and
inverter operations.
 NAND is a contraction of NOT-AND
 AND function with complemented output

 Logic Expression
 Z=XY

 Logic Operation
 Output Z is 0 when all inputs are 1

 Output Z is 1 when at least one of the inputs is 0

X
Z
Y
AAIT, Department of
Electrical and Computer 20 Nebyu Yonas Sutri
Engineering
The NAND Gate

Timing Diagram Truth table


X Y Z

Z 1 1 1 0

AAIT, Department of
Electrical and Computer 21 Nebyu Yonas Sutri
Engineering
NAND Gate is a Universal Gate

NAND gates can be used to implement any Boolean function

AAIT, Department of
Electrical and Computer 22 Nebyu Yonas Sutri
Engineering
The NOR Gate
 A universal gate
 Used in combination to perform AND, OR and
inverter operations.
 NOR is a contraction of NOT-OR
 OR function with complemented output

 Logic Expression
 Z = X+Y

 Logic Operation
 Output Z is 1 when all inputs X, Y are 0

 Output Z is 0 when at least one of the inputs is 1

X
Z
Y
AAIT, Department of
Electrical and Computer 23 Nebyu Yonas Sutri
Engineering
The NOR Gate

Timing Diagrams Truth Table

X Y Z

Z 1 0 0 0

AAIT, Department of
Electrical and Computer 24 Nebyu Yonas Sutri
Engineering
NOR Gate is a universal gate

NOR gates can be used to implement any Boolean function

AAIT, Department of
Electrical and Computer 25 Nebyu Yonas Sutri
Engineering
The Exclusive-OR Gates

 Formed by a combination of other


gates
XOR truth table
 Important in many application
 Logic Operation
• Output Z is 1 when X and Y are different.
• Output Z is 0 when X and Y are same.
AAIT, Department of
Electrical and Computer 26 Nebyu Yonas Sutri
Engineering
The Exclusive-NOR Gates

 Logic Operation
• Output Z is 0 when XNOR truth table
X and Y are
different.
• Output Z is 1 when
X and Y are same.
AAIT, Department of
Electrical and Computer 27 Nebyu Yonas Sutri
Engineering
Boolean Algebra
 Mathematics of digital system
 Important in the analysis of logic circuit
 Boolean algebra defines 3 operations:
 addition,
 multiplication, and
 complementation.
 These correspond to the logic operations OR,
AND and NOT respectively.
 The theorems of Boolean Algebra are
presented in a table on the following slide
AAIT, Department of
Electrical and Computer 28 Nebyu Yonas Sutri
Engineering
Boolean Addition and Multiplication
 The rules for Boolean Addition are:
0+0=0
0+1=1
1+0=1
1+1=1

 The rules for Boolean Multiplication are:


00=0
01=0
10=0
11=1

AAIT, Department of
Electrical and Computer 29 Nebyu Yonas Sutri
Engineering
Commutative Law
 The order in which the variables are ORed or
ANDed does NOT matter.
 Commutative law for addition(OR):
A+B=B+A
A
B
A+B  B
A
B+A

 Commutative law for multiplication(AND):


AB = BA
A
B
AB  B
A
BA

AAIT, Department of
Electrical and Computer 30 Nebyu Yonas Sutri
Engineering
Associative Law
 The order the variables are grouped when ANDing
or ORing more than 2 variables does NOT matter.
 Associative law for addition(OR):
A + (B +C) = (A + B) + C
A


A A + (B + C)
B (A + B) + C
B
C C
 Associative law for multiplication(AND):
A(BC) = (AB)C
A


A A (BC)
B (A B)C
B
C C
AAIT, Department of
Electrical and Computer 31 Nebyu Yonas Sutri
Engineering
Distributive Law

 ORing 2 or more variables and then ANDing


the result with a single variable is equivalent
to ANDing the single variable with each of the
two or more variables and then ORing the
products.
A(B + C) = AB + AC

AAIT, Department of
Electrical and Computer 32 Nebyu Yonas Sutri
Engineering
Rules of Boolean Algebra
 Rule 1: A + 0 = A
 A variable ORed with 0 is always equal to the
variable
 Proof : When A = 0  0 + 0 = 0 = A
When A = 1  1 + 0 = 1 = A
 Rule 2: A + 1 = 1
 A variable ORed with 1 is always equal to 1
 Proof: When A = 0 0+1=1
When A = 1 1+1=1

AAIT, Department of
Electrical and Computer 33 Nebyu Yonas Sutri
Engineering
Rules of Boolean Algebra
 Rule 3: A  0 = 0
 A variable ANDed with 0 is always equal to 0
 Proof : When A = 0  0  0 = 0
When A = 1  1  0 = 0
 Rule 4: A  1 = A
 A variable ANDed with 1 is always equal to the
variable
 Proof: When A = 0 01=0=A
When A = 1 11=1=A

AAIT, Department of
Electrical and Computer 34 Nebyu Yonas Sutri
Engineering
Rules of Boolean Algebra
 Rule 5: A + A = A
 A variable ORed with itself is always equal to the
variable
 Proof : When A = 0  0 + 0 = 0 = A
When A = 1  1 + 1 = 1 = A
 Rule 6: A + A’ = 1
 A variable ORed with its complement is always equal
to 1
 Proof: When A = 0 1+0=1
When A = 1 0+1=1

AAIT, Department of
Electrical and Computer 35 Nebyu Yonas Sutri
Engineering
Rules of Boolean Algebra
 Rule 7: A  A = A
 A variable ANDed with itself is always equal to the
variable
 Proof : When A = 0  0  0 = 0 = A
When A = 1  1  1 = 1 = A
 Rule 8: A  A’ = 0
 A variable ANDed with its complement is always equal
to 0
 Proof: When A = 0 01=0
When A = 1 10=0

AAIT, Department of
Electrical and Computer 36 Nebyu Yonas Sutri
Engineering
Rules of Boolean Algebra

 Rule 9: A’’ = A
 The double complement is always equal to the
variable 0 1 0
 Proof : 1 0 1

 Rule 10: A + AB = A
 Proof: A(1+B)  Distributive law
1+B = 1  Rule 2
A(1) = A  Rule 4

AAIT, Department of
Electrical and Computer 37 Nebyu Yonas Sutri
Engineering
Rules of Boolean Algebra

 Rule 11: A + A’B= A + B


 Proof : A = A + AB  Rule 10
A + A’B = A + AB + A’B
= A + B(A + A’)  Distributive Law
= A + B(1)  Rule 6
=A+B  Rule 4

AAIT, Department of
Electrical and Computer 38 Nebyu Yonas Sutri
Engineering
Rules of Boolean Algebra

 Rule 12: (A + B)(A + C) = A + BC


 Proof: (A + B) (A +C)
= AA +AC + AB + BC  expand
= A + AC + AB +BC  Rule 7
= A(1 + C + B) + BC  factorize
= A(1) + BC  Rule 2
= A + BC  Rule 4

AAIT, Department of
Electrical and Computer 39 Nebyu Yonas Sutri
Engineering
Summary of Laws of Boolean Algebra

AAIT, Department of
Electrical and Computer 40 Nebyu Yonas Sutri
Engineering
Summary of Laws of Boolean Algebra

AAIT, Department of
Electrical and Computer 41 Nebyu Yonas Sutri
Engineering
De Morgan’s Theorem
 The next set of relationships are known as
De Morgan’s Theorems and they are very
important as we shall see later.

AAIT, Department of
Electrical and Computer 42 Nebyu Yonas Sutri
Engineering
Describing Logic Circuits Algebraically
 The three basic Boolean operations (OR,
AND, NOT) can describe any logic circuit.
 If an expression contains both AND and OR
gates, the AND operation will be performed
first, unless there is a parenthesis in the
expression.
 Example: A+B.C ≠ (A+B).C
 You may use parenthesis all the time to
avoid vagueness
AAIT, Department of
Electrical and Computer 43 Nebyu Yonas Sutri
Engineering
Describing Logic Circuits Algebraically
 Examples of Boolean expressions for logic
circuits:

AAIT, Department of
Electrical and Computer 44 Nebyu Yonas Sutri
Engineering
Describing Logic Circuits Algebraically

 The output of an inverter is equivalent to the


input with a bar over it. Input A through an
inverter equals A.
 Examples using inverters.

AAIT, Department of
Electrical and Computer 45 Nebyu Yonas Sutri
Engineering
Examples on Boolean Logic

AAIT, Department of
Electrical and Computer 46 Nebyu Yonas Sutri
Engineering
Evaluating Logic Circuit Outputs

 Rules for evaluating a Boolean expression:


 Perform all inversions of single terms.
 Perform all operations within parenthesis.
 Perform AND operation before an OR operation
unless parenthesis indicate otherwise.
 If an expression has a bar over it, perform the
operations inside the expression and then invert
the result.

AAIT, Department of
Electrical and Computer 47 Nebyu Yonas Sutri
Engineering
Evaluating Logic Circuit Outputs
 Method 1: Evaluate Boolean expressions by
substituting values and performing the
indicated operations.
A  0, B  1, C  1, and D  1
x  ABC(A  D)
 0 1 1  (0  1)
 1 1 1  (0  1)
 1 1 1  (1)
 1 1  1  0
0
AAIT, Department of
Electrical and Computer 48 Nebyu Yonas Sutri
Engineering
Evaluating Logic Circuit Outputs
 Method 2: Output logic levels can be
determined directly from a circuit diagram.
 The output of each gate is noted until a final
output is found.

AAIT, Department of
Electrical and Computer 49 Nebyu Yonas Sutri
Engineering
Implementing Circuits From Boolean
Expressions
 It is important to be able to draw a logic circuit from a
Boolean expression.
 The expression
x  A BC
could be drawn as a three input AND gate.

 A more complex example such as


y  AC  BC  ABC

could be drawn as two 2-input AND gates and one 3-input


AND gate feeding into a 3-input OR gate. Two of the AND
gates have inverted inputs.
AAIT, Department of
Electrical and Computer 50 Nebyu Yonas Sutri
Engineering
Implementing Circuits From Boolean
Expressions
Example 1:

AAIT, Department of
Electrical and Computer 51 Nebyu Yonas Sutri
Engineering
Deriving Boolean Expressions from
given circuit

Example 2:

AAIT, Department of
Electrical and Computer 52 Nebyu Yonas Sutri
Engineering
Algebraic Manipulation
Example 3: Consider the following function

F  XYZ  XYZ  XZ

Circuit construction using logic gates:

AAIT, Department of
Electrical and Computer 53 Nebyu Yonas Sutri
Engineering
Algebraic Manipulation
We can also simplify the expression using the Boolean
and De Morgan’s law.

F  XYZ  XYZ  XZ
Apply

F  XY ( Z  Z )  XZ
Apply

F  XY  1  XZ
Apply
F  XY  XZ
AAIT, Department of
Electrical and Computer 54 Nebyu Yonas Sutri
Engineering
Algebraic Manipulation
It results to fewer gates implementation

Initial design

Simplified
design

AAIT, Department of
Electrical and Computer 55 Nebyu Yonas Sutri
Engineering
Homework

 Proof (to yourself) rule 10 to rule 12 of


Boolean theorems and the two laws of De
Morgan’s theorem.

AAIT, Department of
Electrical and Computer 56 Nebyu Yonas Sutri
Engineering

You might also like