You are on page 1of 38

Digital Logic Design

02 – Switching Algebra and Combinational Logic


Binary Logic

DATE : 18/10/2022 2
Definition of Binary Logic
• Binary logic consists of binary variables and a set of logical
operations
• Variables:
• Are designated by letters of the alphabet, such as 𝐴, 𝐵, 𝐶, 𝑥, 𝑦, 𝑧, …
• Have two and only two distinct values: 1 and 0
• Logical Operations:
• There are three basic logical operations
• AND, OR, and NOT

3
AND
• AND operation is represented by a dot (⋅) or by the absence of an
operator
• Example: 𝑋 ⋅ 𝑌 = 𝑍 or 𝑋𝑌 = 𝑍
• 𝑋, 𝑌, and 𝑍 are binary variables and can be equal to either 1 or 0, nothing
else
• “𝑋 AND 𝑌 is equal to 𝑍”
• 𝑍 = 1 if and only if 𝑋 = 1 and 𝑌 = 1; otherwise 𝑍 = 0

4
OR
• OR operation is represented by a plus (+)
• Example: 𝑋 + 𝑌 = 𝑍
• “𝑋 OR 𝑌 is equal to 𝑍”
• 𝑍 = 1 if 𝑋 = 1 or 𝑌 = 1 or if both 𝑋 = 1 and 𝑌 = 1
• If both 𝑋 = 0 and 𝑌 = 0, then 𝑍 = 0

5
NOT
• NOT operation is represented by a prime ′ or an overbar ഥ
• Example: 𝑋 ′ = 𝑍 or 𝑋ത = 𝑍
• “NOT 𝑋 is equal to 𝑍”
• If 𝑋 = 1, then 𝑍 = 0, but if 𝑋 = 0, then 𝑍 = 1
• The NOT operation is also referred to as the complement operation,
since it changes a 1 to a 0 and a 0 to a 1

6
Truth Table
• Definition of logical operations may be listed in a compact form
called truth tables
• A truth table is a table of all possible combinations of the variables,
showing the relation between values the variables can take and the
result of the operation

7
Logic Gates
• Logic gates are electronic circuits that operate on one or more input
signals to produce an output signal
• Logic circuits respond to two separate voltage levels that represent
binary variable equal to logic 0 or logic 1

8
Logic Gates

9
Logic Gates

10
Basic Theorems

11
Basic Theorems
• Operations with 0 and 1:
𝑋 + 0 = 𝑋, 𝑋⋅1=𝑋
𝑋 + 1 = 1, 𝑋⋅0=0
• Idempotent laws:
𝑋 + 𝑋 = 𝑋, 𝑋⋅𝑋 =𝑋
• Involution law:
𝑋′ ′
=𝑋
• Laws of complementarity:
𝑋 + 𝑋 ′ = 1, 𝑋 ⋅ 𝑋′ = 0

12
Basic Theorems
• Commutative laws:
𝑋𝑌 = 𝑌𝑋, 𝑋+𝑌 =𝑌+𝑋
• Associative laws:
𝑋𝑌 𝑍 = 𝑋 𝑌𝑍 = 𝑋𝑌𝑍, 𝑋+𝑌 +𝑍 =𝑋+ 𝑌+𝑍 =𝑋+𝑌+𝑍

13
Basic Theorems
• Distributive laws:
𝑋 𝑌 + 𝑍 = 𝑋𝑌 + 𝑋𝑍, 𝑋 + 𝑌𝑍 = (𝑋 + 𝑌)(𝑋 + 𝑍)

• Absorption law:
𝑋 + 𝑋𝑌 = 𝑋, X 𝑋+𝑌 =𝑋

• Combining law:
𝑋𝑌 + 𝑋𝑌 ′ = 𝑋, 𝑋 + 𝑌 𝑋 + 𝑌′ = 𝑋

14
Basic Theorems
• Consensus law:
𝑋𝑌 + 𝑋 ′ 𝑍 + 𝑌𝑍 = 𝑋𝑌 + 𝑋 ′ 𝑍

𝑋 + 𝑌 𝑋′ + 𝑍 𝑌 + 𝑍 = 𝑋 + 𝑌 𝑋′ + 𝑍

• DeMorgan’s laws:
𝑋+𝑌 ′ = 𝑋 ′ 𝑌′, 𝑋𝑌 ′ = 𝑋 ′ + 𝑌′
Examples:
• Simplify the following Boolean functions to a minimum number of
literals
1. 𝑥 𝑥′ + 𝑦
2. 𝑥 + 𝑥′𝑦
3. 𝑥 + 𝑦 𝑥 + 𝑦′
4. 𝑥𝑦 + 𝑥 ′ 𝑧 + 𝑦𝑧
5. (𝑥 + 𝑦)(𝑥 ′ + 𝑧)(𝑦 + 𝑧)

16
Examples:
1. 𝑥 𝑥 ′ + 𝑦
= 𝑥𝑥 ′ + 𝑥𝑦
= 0 + 𝑥𝑦
= 𝑥𝑦
2. 𝑥 + 𝑥 ′ 𝑦
= 𝑥 + 𝑥′ 𝑥 + 𝑦
=1 𝑥+𝑦
=𝑥+𝑦

17
Examples:
3. 𝑥 + 𝑦 (𝑥 + 𝑦′)
= 𝑥 + 𝑥𝑦 + 𝑥𝑦 ′ + 𝑦𝑦 ′
= 𝑥(1 + 𝑦 + 𝑦′)
=𝑥
4. 𝑥𝑦 + 𝑥 ′ 𝑧 + 𝑦𝑧
= 𝑥𝑦 + 𝑥 ′ 𝑧 + 𝑦𝑧 𝑥 + 𝑥 ′
= 𝑥𝑦 + 𝑥 ′ 𝑧 + 𝑥𝑦𝑧 + 𝑥 ′ 𝑦𝑧
= 𝑥𝑦 1 + 𝑧 + 𝑥 ′ 𝑧 1 + 𝑦
= 𝑥𝑦 + 𝑥 ′ 𝑧

18
Examples:
5. (𝑥 + 𝑦)(𝑥 ′ + 𝑧)(𝑦 + 𝑧)
= (𝑥 + 𝑦)(𝑥 ′ + 𝑧)(𝑦 + 𝑧 + 𝑥𝑥 ′ )
= (𝑥 + 𝑦)(𝑥 ′ + 𝑧)(𝑥 + 𝑦 + 𝑧)(𝑥 ′ + 𝑦 + 𝑧)
= 𝑥 + 𝑦 𝑥′ + 𝑧

19
Examples
• Find the complement of the functions
𝐹1 = 𝑥 ′ 𝑦𝑧 ′ + 𝑥 ′ 𝑦 ′ 𝑧
𝐹1′ = 𝑥 ′ 𝑦𝑧 ′ + 𝑥 ′ 𝑦 ′ 𝑧 ′
= 𝑥 ′ 𝑦𝑧 ′ ′ 𝑥 ′ 𝑦 ′ 𝑧 ′
= 𝑥 + 𝑦′ + 𝑧 𝑥 + 𝑦 + 𝑧′

𝐹2 = 𝑥 𝑦 ′ 𝑧 ′ + 𝑦𝑧
𝐹2′ = 𝑥 𝑦 ′ 𝑧 ′ + 𝑦𝑧 ′
= 𝑥 ′ + 𝑦 ′ 𝑧 ′ + 𝑦𝑧 ′
= 𝑥 ′ + 𝑦 ′ 𝑧 ′ ′ 𝑦𝑧 ′
= 𝑥′ + 𝑦 + 𝑧 𝑦′ + 𝑧′
= 𝑥 ′ + 𝑦𝑧 ′ + 𝑦 ′ 𝑧

20
NAND Gate
X Y Z
0 0 1
0 1 1
1 0 1
1 1 0
NOR Gate
X Y Z
0 0 1
0 1 0
1 0 0
1 1 0
Standard Representations of Logic Functions

23
Truth Tables
• A truth table lists the output of the circuit for every possible
combination of the input
Truth Tables
• Two expressions are equal if they have the same value for every possible
combination of the variables
• Using the truth table (number of entries in the truth table is equal to 2𝑛 , where
𝑛 is the number of variables in the expression), we can show that

𝐴𝐵′ + 𝐶 = 𝐴 + 𝐶 𝐵′ + 𝐶

25
Definitions
• Literal: A variable or the complement of a variable.
Ex: 𝑋, 𝑌, 𝑋 ′ , 𝑌′

• Product Term: A single literal or a logical product of two or more


literals.
Ex: 𝑍 ′ , 𝑊 ⋅ 𝑋 ⋅ 𝑌, 𝑋 ⋅ 𝑌 ′ ⋅ 𝑍, 𝑊 ′ ⋅ 𝑌 ′ ⋅ 𝑍

• Sum Term: A single literal or a logical sum of two or more literals.


Ex: 𝑍 ′ , 𝑊 + 𝑋 + 𝑌, 𝑋 + 𝑌 ′ + 𝑍, 𝑊 ′ + 𝑌 ′ + 𝑍
Definitions
• Sum-of-Products expression: A logical sum of product terms.
Ex: 𝑍 ′ + 𝑊 ⋅ 𝑋 ⋅ 𝑌 + 𝑋 ⋅ 𝑌 ′ ⋅ 𝑍 + 𝑊 ′ ⋅ 𝑌 ′ ⋅ 𝑍

• Product-of-Sums expression: A logical product of sum terms.


Ex: 𝑍 ′ ⋅ 𝑊 + 𝑋 + 𝑌 ⋅ 𝑋 + 𝑌 ′ + 𝑍 ⋅ 𝑊 ′ + 𝑌 ′ + 𝑍
Definitions
• 𝑛-variable Minterm: a normal product term with 𝑛 literals. There are
2𝑛 such product terms.
For 𝑛 = 2, 𝑥 ′ 𝑦 ′ , 𝑥 ′ 𝑦, 𝑥𝑦 ′ , 𝑥𝑦

• 𝑛-variable Maxterm: a normal sum term with 𝑛 literals. There are 2𝑛


such product terms.
For 𝑛 = 2, 𝑥 ′ + 𝑦 ′ , 𝑥 ′ + 𝑦, 𝑥 + 𝑦 ′ , 𝑥 + 𝑦
Minterms and Maxterms
• Minterm: A product term that is 1 in exactly one row of the truth table
• Maxterm: A sum term that is 0 in exactly one row of the truth table

• Minterm 𝑖 (𝑚𝑖 ) denotes the minterm corresponding to row 𝑖 of the truth


table.
• Maxterm 𝑖 (𝑀𝑖 ) denotes the maxterm corresponding to row 𝑖 of the truth
table.

• Each minterm is the complement of its maxterm and vice versa 𝑚𝑗′ = 𝑀𝑗
Minterms and Maxterms

30
Canonical Forms: Sum of Minterms
• A Boolean function 𝑓1 can be expressed by
• A truth table
• Sum of the minterms corresponding to truth table rows (input combinations)
for which the 𝑓1 = 1

31
Canonical Forms: Sum of Minterms

• 𝑓1 = 𝑥 ′ 𝑦 ′ 𝑧 + 𝑥𝑦 ′ 𝑧 ′ + 𝑥𝑦𝑧 = 𝑚1 + 𝑚4 + 𝑚7 = σ 𝑚 1,4,7
• 𝑓2 = 𝑥 ′ 𝑦𝑧 + 𝑥𝑦 ′ 𝑧 + 𝑥𝑦𝑧 ′ + 𝑥𝑦𝑧 = 𝑚3 + 𝑚5 + 𝑚6 + 𝑚7 = σ 𝑚 3,5,6,7
32
Canonical Forms: Sum of Minterms
• A Boolean function 𝑓1 can be expressed by
• A truth table
• Product of the maxterms corresponding to truth table rows (input
combinations) for which the 𝑓1 = 0

33
Canonical Forms: Product of Maxterms

• 𝑓1 = 𝑥 + 𝑦 + 𝑧 𝑥 + 𝑦 ′ + 𝑧 𝑥 + 𝑦 ′ + 𝑧 ′ 𝑥 ′ + 𝑦 + 𝑧 ′ 𝑥 ′ + 𝑦 ′ + 𝑧 =
𝑀0 ⋅ 𝑀2 ⋅ 𝑀3 ⋅ 𝑀5 ⋅ 𝑀6 = ς 𝑀 0,2,3,5,6

34
Examples:
• Express the function 𝐹 = 𝐴 + 𝐵′ 𝐶 as a sum of
minterms

• The function has 3 variables


The first term is missing two variables
𝐴 = 𝐴 𝐵 + 𝐵′ 𝐶 + 𝐶 ′
= 𝐴𝐵𝐶 + 𝐴𝐵𝐶 ′ + 𝐴𝐵′ 𝐶 + 𝐴𝐵′ 𝐶′
The second term is missing one variable
𝐵′ 𝐶 = 𝐵′ 𝐶 𝐴 + 𝐴′ = 𝐴𝐵′ 𝐶 + 𝐴′ 𝐵′ 𝐶
Combining the terms
𝐹 = 𝐴′ 𝐵′ 𝐶 + 𝐴𝐵′ 𝐶 ′ + 𝐴𝐵′ 𝐶 + 𝐴𝐵𝐶 ′ + 𝐴𝐵𝐶
= 𝑚1 + 𝑚4 + 𝑚5 + 𝑚6 + 𝑚7
It could be built from the truth table
as well
• Can be written as 𝑭 𝑨, 𝑩, 𝑪 = σ 𝒎(𝟏, 𝟒, 𝟓, 𝟔, 𝟕)

35
Examples:
Express the Boolean function 𝐹 = 𝑥𝑦 + 𝑥 ′ 𝑧 as a product of maxterms

First convert into OR terms using the distributive law


𝐹 = 𝑥𝑦 + 𝑥 ′ 𝑧 = 𝑥𝑦 + 𝑥 ′ 𝑥𝑦 + 𝑧
= 𝑥 + 𝑥′ 𝑦 + 𝑥′ 𝑥 + 𝑧 𝑦 + 𝑧
= (𝑥 ′ + 𝑦)(𝑥 + 𝑧)(𝑦 + 𝑧)
The function has 3 variables, each OR term is missing one variable
𝑥 ′ + 𝑦 = 𝑥 ′ + 𝑦 + 𝑧𝑧 ′ = 𝑥 ′ + 𝑦 + 𝑧 𝑥 ′ + 𝑦 + 𝑧 ′
𝑥 + 𝑧 = 𝑥 + 𝑧 + 𝑦𝑦 ′ = 𝑥 + 𝑦 + 𝑧 𝑥 + 𝑦 ′ + 𝑧
𝑦 + 𝑧 = 𝑦 + 𝑧 + 𝑥𝑥′ = (𝑥 + 𝑦 + 𝑧)(𝑥 ′ + 𝑦 + 𝑧)
Therefore,
𝐹 = 𝑥 + 𝑦 + 𝑧 𝑥 + 𝑦 ′ + 𝑧 𝑥 ′ + 𝑦 + 𝑧 𝑥 ′ + 𝑦 + 𝑧 ′ = 𝑀0 + 𝑀2 + 𝑀4 + 𝑀5
More conveniently, 𝑭 𝒙, 𝒚, 𝒛 = ς 𝑴 𝟎, 𝟐, 𝟒, 𝟓

36
Conversion between Canonical Forms
• The complement of a function expressed as the sum of minterms
equals the sum of minterms missing from the original function
𝐹(𝐴, 𝐵, 𝐶) = ෍ 𝑚 1, 4, 5, 6, 7

𝐹(𝐴, 𝐵, 𝐶) = ෑ 𝑀(0, 2, 3)

• Sum of minterms = product of maxterms


• Interchange the symbols S and P and list those numbers missing
from the original form
37
Conversion between Canonical Forms
• Example: 𝐹 = 𝑥𝑦 + 𝑥 ′ 𝑧

From the truth table


𝐹 𝑥, 𝑦, 𝑧 = 𝑥 ′ 𝑦 ′ 𝑧 + 𝑥 ′ 𝑦𝑧 + 𝑥𝑦𝑧 ′ + 𝑥𝑦𝑧
= ෍ 𝑚(1, 3, 6, 7)

Equivalently,
𝐹 𝑥, 𝑦, 𝑧 = ෑ 𝑀 0, 2, 4, 5

38

You might also like