# Digital Logic and Design

Dr. M. edit Master subtitle style Click toNajam ul Islam PhD Electrical Engineering

Slides set 4 : Boolean Algebra

22

Digital Logic
• Parity Bit • Binary Cell

• Output: Physical quantity • Register • Group of binary cell • Example • 1100 00011 1100 1001 • Integer • ASCII • Excess – 3 • BCD
33

Register Transfer / Data Transfer

44

Digital Logic
• Logic Theory is that branch of mathematics which
deals with the truthfulness of a rational statement. Example: • “Switches A & B must be closed to turn ON a lamp” this statement can be tested for its truthfulness as follows:

a. Is it necessary to have both the switches closed b. c.

simultaneously for lamp to turn on? Will the lamp turn ON if switch A or switch B is closed? What will happen if both switches are open?

55

Binary Logic
• Consists of binary (two-value) variables and logical
operations

• Variables are A, B, C, x, y, z etc. • logical operations AND, OR, NOT etc.

66

Basic Logic Gates
• OR Operator
represented by + sign

• AND Operator

represented by . sign

• NOT Operator

represented by '

77

Basic Logic Gates

88

Multiple Input Gates

99

Secondary Logic Gates (1)
• Buffer • NAND

• NOR

1010

Secondary Logic Gates (2)
• XOR (Exclusive-OR)

• XNOR (Exclusive-NOR)

1111

Exercise (1)

• f = (a b c) ' • g = (a + b + c) '
1212

Exercise (2)

• f = (a ⊕ b) • g = (a ⊕ b)'
1313

Boolean Algebra

• An algebra that deals with binary variables
and logic operations.

• Developed by George Boole in 1854 • Shannon introduced two-valued Boolean

algebra in 1938. • Huntington formulated the formal definition of Boolean algebra through the postulates in 1904.

1414

Postulates for Boolean Algebra
• Postulate 1: Closure property for + and . • Postulate 2: Identity law, 0 for +, 1 for .

x.1=x • x + 0 = x; • Postulate 3: Commutative property for + and . • x + y = y + x; x . y = y . x • Postulate 4: Distributive property (. over +, + over .) • x . (y + z) = (x . y) + (x . z) • x + (y . z) = (x + y) . (x + z) • Postulate 5: Complement (for every x there is an x’) • x + x’ = 1 • x . x’ = 0

1515

Basic Theorems for Boolean Algebra
• Straight Simplification using these theorems • Duality principle: One expression can be

reformulated if the binary operators and the identity elements are interchanged.

Theorem # 1: (Idempotency Law)

• (x + x) = x • (x . x) = x
1616

Basic Theorems for Boolean Algebra
Theorem # 2:

• x+1=1 •x.0=0

(any variable + 1 = 1)

(any variable AND with 0 = 0 )

1717

Basic Theorems for Boolean Algebra
Theorem # 3: (Involution or Double Negation)

• (x’)’ = x

1818

Basic Theorems for Boolean Algebra
Theorem # 4: (Associative Law) If x , y & z are three variables, then

• x + (y + z) = (x + y) + z • x . (y . z) = (x . y) . z

1919

Basic Theorems for Boolean Algebra
Theorem # 5: (Demorgan’s Law) If x & y are two variables, then

• (x + y)’ = x’ . y’ • (x . y)’ = x’ + y’
Demorgan’s Laws are one of the most important set of Boolean Algebraic Laws.
2020

Basic Theorems for Boolean Algebra
Theorem # 6: (Absorption Law)

• If x & y are two variables then,
x + xy = x or x(x + y) = x (through duality) • Here variable y is absorbed by the variable x. Similarly • x + x’y = x + y • x(x’ + y) = xy • x’ + xy = x’ + y • x’(x + y) = x’y

2121

Proof
• Absorption Law
x + xy = x Proof: x + xy = x (1 + y) = x (1) =x Hence Proved

2222

Simplification by using Basic Rules
• Similarly:
x + x’y = x + y Proof:
As 1 + y = 1 and x.1 = x

x + x’y = x (1 + y) + x’y = x + xy + x’y = x + (x + x’) y =x+y

2323

Basic Theorems for Boolean Algebra
Theorem # 7: (Consensus Theorem) If x , y and z are three variables then,

• (x.y) + (y.z) + (z.x’) = (x.y) + (z.x’)
The proofs of all the above laws can also be obtained by using truth table.

2424

Proof
• Consensus Theorem
(x.y) + (y.z) + (z.x’) = (x.y) + (z.x’) Proof: (x.y) + (y.z) + (z.x’) = xy + (x + x’)yz + x’z = xy + xyz + x’yz + x’z = xy(1 + z) + x’z(y + 1) = xy + x’z

2525

Rule Number Boolean Expression 1 2 3 4 5 6 7 8 9 10 11 12 2626

Prove that (A + B) (A + C) = A + BC
(A + B) (A+C) = AA +AC + BA + BC Distributive law = A + AC + BA + BC Rule #7 = A (1 + C) + BA + BC Distributive law = A.1 +BA + BC Rule 2 = A + BA + BC Rule 4 = A (1 + B) + BC Distributive law = A.1 + BC Rule 2 = A + BC

2727

Operator Precedence
Operator Precedence for evaluating Boolean expressions is

• Parentheses • NOT • AND • OR

2828

Boolean Functions
• 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. Example: F1 = x + y'z • The function F1 is equal to 1 if x is equal to 1 or if both y' and z

are equal to 1. The complement operation dictates that when y' = 1, y = 0. Therefore, F1 = 1 if x = 1 or if y = 0 and z = 1. F1 is equal to 0 otherwise.

2929

Truth table for function F1

Gate implementation of F1 = x + y' z
3030

Another Example
Boolean function F2 = x' y' z + x' y z + x y' Simplifies to F2 = x' y' z + x' y z + x y' = x' z (y' + y) + x y' = x' z + x y'

3131

Truth table for Function F2

F2 = x' y' z + x' y z + x y‘ F2 = x' z + x y'
3232

Gate Implementation of F2
Gate implementation of function F2

Gate implementation of simplified form of function F2

3333

Complement of a Function
• Complement of a function F is F' • Obtained from an interchange of 0’s for 1’s and 1’s for 0’s
in the value of F. Theorems.

• Algebraically may be derived through DeMorgan’s

3434

Canonical and Standard Forms
• Canonical form: consists of terms comprising of all
variables e.g., xy + x' y' • Sum of Product (SOP)
• Sum of Minterms • Standard Product • (XZ) + (Y' Z) + (X' YZ)

• Product of Sum (POS)

• Standard form: a reduced (short) form of canonical
expression.

• Product of Maxterms • Standard Sums • (X + Z) (Y' + Z) (X' + Y + Z)

3535

Minterms & Maxterms
• A minterm is a special product of literals, in which
each input variable appears exactly once. • A function with N variables has 2N minterms (since each variable can appear complemented or not) • A three-variable function, such as f(x,y,z), has 23 = 8 minterms: • Each minterm is true for exactly one combination of inputs:
x’y’z’ - x’y’z - x’yz’ - x’yz - xy’z’ - x y’z - xyz’ - xyz

3636

Minterm Is True when
Minterm x’y’z’ x’y’z x’yz’ x’yz xy’z’ xy’z xyz’ xyz
3737

Condition x=0, y=0, z=0 x=0, y=0, z=1 x=0, y=1, z=0 x=0, y=1, z=1 x=1, y=0, z=0 x=1, y=0, z=1 x=1, y=1, z=0 x=1, y=1, z=1

Shorthand m0 m1 m2 m3 m4 m5 m6 m7

Sum of Minterms Form
• Every function can be written as a sum of minterms,
which is a special kind of sum of products form unique

• The sum of minterms form for any function is • If you have a truth table for a function, you can

write a sum of minterms expression just by picking out the rows of the table where the function output is 1.

3838

Example
x 0 0 0 0 1 1 1 1
3939

y 0 0 1 1 0 0 1 1

z 0 1 0 1 0 1 0 1

f(x,y,z) 1 1 1 1 0 0 1 0

f’(x,y,z) 0 0 0 0 1 1 0 1

Example
f = x’y’z’ + x’y’z + x’yz’ + x’yz + xyz’ = m0 + m1 + m2 + m3 + m6 f(x,y,z) = Σ (0,1,2,3,6)

f’ = xy’z’ + xy’z + xyz = m4 + m5 + m7 = Σ (4,5,7) f’ contains all the minterms not in f

4040

Product of Maxterms
• A product of sums (POS) expression contains:
• Only AND (product) operations at the “outermost” level • Each term must be a sum of literals
with two-level circuits

• Product of sums expressions can be implemented
• literals and their complements at the “0th” level • OR gates at the first level • a single AND gate at the second level

• Compare this with sums of products
4141

Product of Maxterms
• A maxterm is a sum of literals, in which each input
variable appears exactly once.

• A function with N variables has 2N maxterms • The maxterms for a three-variable function f(x,y,z):
x’ + y’ + z’ x’ + y’ + z x + y’ + z’ x’ + y + z’ x’+ y + z x + y’ + z x + y + z’x + y + z

4242

Maxterm Is false when
Maxterm x+y+z x + y + z’ x + y’ + z x + y’ + z’ x’ + y + z x’ + y + z’ x’ + y’ + z x’ + y’ + z’
4343

Condition x=0, y=0, z=0 x=0, y=0, z=1 x=0, y=1, z=0 x=0, y=1, z=1 x=1, y=0, z=0 x=1, y=0, z=1 x=1, y=1, z=0 x=1, y=1, z=1

Shorthand M0 M1 M2 M3 M4 M5 M6 M7

Product of Maxterms
• Every function can be written as a unique product of
maxterms

• If you have a truth table for a function, you can

write a product of maxterms expression by picking out the rows of the table where the function output is 0.

4444

Example
x 0 0 0 0 1 1 1 1
4545

y 0 0 1 1 0 0 1 1

z 0 1 0 1 0 1 0 1

f(x,y,z) 1 1 1 1 0 0 1 0

f’(x,y,z) 0 0 0 0 1 1 0 1

Example
f = (x’ + y + z)(x’ + y + z’)(x’ + y’ + z’) = M4 M5 M7 = Π (4,5,7) f’ = (x + y + z)(x + y + z’)(x + y’ + z) (x + y’ + z’)(x’ + y’ + z) = M0 M1 M2 M3 M6 = Π (0,1,2,3,6) f’ contains all the maxterms not in f
4646

Minterms and Maxterms are Related
• Any minterm mi is the complement of the corresponding
maxterm Mi
Minterm x’y’z’ x’y’z x’yz’ x’yz xy’z’ xy’z xyz’ xyz
4747

Shorthand m0 m1 m2 m3 m4 m5 m6 m7

Minterms and Maxterms are Related
Maxterm x+y+z x + y + z’ x + y’ + z x + y’ + z’ x’ + y + z x’ + y + z’ x’ + y’ + z x’ + y’ + z’ Shorthand M0 M1 M2 M3 M4 M5 M6 M7

For example, m4’ = M4 because (xy’z’)’ = x’ + y + z
4848

Conversion between Canonical Forms
• We can convert a sum of minterms to a product of
maxterms

• In general, just replace the minterms with maxterms,
using maxterm numbers that don’t appear in the sum of minterms product of maxterms to a sum of minterms

• The same thing works for converting from a

4949

Conversion between Canonical Forms
From Previous Example; f = Σ (0,1,2,3,6) and f’ = Σ (4,5,7) = m4 + m5 + m7 complementing (f’)’ = (m4 + m5 + m7)’ f = m4’ m5’ m7’ [DeMorgan’s law] = M4 M5 M7 [By the previous page] = Π (4,5,7)

5050

Conversion between Canonical Forms
• In general, just replace the minterms with maxterms,
using maxterm numbers that don’t appear in the sum of minterms: f = Σm(0,1,2,3,6) = ΠM(4,5,7)

• The same thing works for converting from a product
of maxterms to a sum of minterms

5151

Equivalent Circuits & its Simplification

5252

Equivalent Circuits & its Simplification

5353

Equivalent Circuits & its Simplification

5454

Equivalent Circuits & its Simplification

5555

• Now simplifying the expression

5656

• Final Simplified Circuit....

5757

• Similarly

5858

Review
• Sum-Of-Products, or SOP, Boolean expressions
may be generated from truth tables quite easily, by determining which rows of the table have an output of 1, writing one product term for each row, and finally summing all the product terms. This creates a Boolean expression representing the truth table as a whole. to implementation as a set of AND gates (products) feeding into a single OR gate (sum).

• Sum-Of-Products expressions lend themselves well

5959

Review
• Product-Of-Sums, or POS, Boolean expressions
may also be generated from truth tables quite easily, by determining which rows of the table have an output of 0, writing one sum term for each row, and finally multiplying all the sum terms. This creates a Boolean expression representing the truth table as a whole. to implementation as a set of OR gates (sums) feeding into a single AND gate (product).

• Product-Of-Sums expressions lend themselves well

6060