ACFrOgBTICzbZgajnUi3e TJwOPELhujoXwlPaX W6TTCoJGxI5810vc8Yd8NTKdHf sa6SxtlxNAaDCVkmq4TLKWNsmbBzXPVYX93O4xjx7qKv-YC-m7kTL8FXxgrB5ZIGn0PTYziVtvC5ADp6U

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 35

Digital Logic & Design

Chapter 2
Shahrima Islam Sonam
Lecturer
Northern University of Business and Technology
Boolean Algebra
Introduction
▪1854: Logical algebra was published by George Boole
known today as “Boolean Algebra”
▪It’s a convenient way and systematic way of expressing
and analyzing the operation of logic circuits.
▪1938: Claude Shannon was the first to apply Boole’s work
to the analysis and design of logic circuits.
Boolean Operations & Expressions
▪ Variable – a symbol used to represent a logical quantity.
▪ Complement – the inverse of a variable and is indicated by a bar over
the variable.
▪ Literal – a variable or the complement of a variable.
Boolean Addition
▪ Boolean addition is equivalent to the OR operation
0+0 = 0 0+1 = 1 1+0 = 1 1+1 = 1

▪ A sum term is produced by an OR operation with no AND


ops involved.
▪ i.e.

▪ A sum term is equal to 1 when one or more of the


literals in the term are 1.
▪ A sum term is equal to 0 only if each of the literals is 0.
Boolean Multiplication
▪ Boolean multiplication is equivalent to the AND
operation
0·0 = 0 0·1 = 0 1·0 = 0 1·1 = 1

▪ A product term is produced by an AND operation with


no OR ops involved.
▪ i.e.
▪ A product term is equal to 1 only if each of the
literals in the term is 1.
▪ A product term is equal to 0 when one or more of
the literals are 0.
Laws & Rules of Boolean Algebra
• The basic laws of Boolean algebra:
• The commutative laws
• The associative laws
• The distributive laws
Commutative Laws
▪ The commutative law of addition for two variables is written as:
A+B = B+A

A B
A+B B+A
B A

▪ The commutative law of multiplication for two variables is


written as: AB = BA
A B
AB B+A
B A
Associative Laws
▪ The associative law of addition for 3 variables is written as: A+(B+C)
= (A+B)+C
A A A+B
A+(B+C)
B B
(A+B)+C
C B+C C

▪ The associative law of multiplication for 3 variables is written as:


A(BC) = (AB)C
A A AB
A(BC)
B B
(AB)C
C BC C
Distributive Laws
▪ The distributive law is written for 3 variables as follows: A(B+C) =
AB + AC

B A A
B+
B B
C C X
X A
A
C A
C
X=A(B X=AB
+C) +AC
Useful laws and theorems
Identity: X + 0 = X X•1=X
Null: X+1=1 X•0=0
Idempotent: X+X=X X•X=X
Involution: (X')' = X
Complementarity: X + X' = 1 X • X' = 0
Commutative: X+Y=Y+X X•Y=Y•X
Associative: (X+Y)+Z=X+(Y+Z) (X•Y)•Z=X•(Y•Z)
Distributive: X•(Y+Z)=(X•Y)+(X•Z) X+(Y•Z)=(X+Y)•(X+Z)
Absorption: X+X•Y=X X•(X+Y)=X
Absorption (#2): (X+Y')•Y=X•Y (X•Y')+Y=X+Y
DeMorgan’s Theorems
▪ DeMorgan’s theorems provide mathematical verification of:
▪ the equivalency of the NAND and negative-OR gates
▪ the equivalency of the NOR and negative-AND gates.
DeMorgan’s Theorems
• The complement of two or more NAND Negative-OR
ANDed variables is equivalent to the
OR of the complements of the
individual variables.

• The complement of two or more NOR Negative-AND


ORed variables is equivalent to the
AND of the complements of the
individual variables.
DeMorgan’s Theorems (Exercises)
• Apply DeMorgan’s theorems to the expressions:
DeMorgan’s Theorems (Exercises)
• Apply DeMorgan’s theorems to the expressions:
Proving theorems
▪ Example 1: Prove the uniting theorem-- X•Y+X•Y'=X
Distributive X•Y+X•Y' = X•(Y+Y')
Complementarity = X•(1)
Identity =X

▪ Example 2: Prove the absorption theorem-- X+X•Y=X


Identity X+X•Y = (X•1)+(X•Y)
Distributive = X•(1+Y)
Null = X•(1)
Identity =X
de Morgan’s Theorem
• Use de Morgan’s Theorem to find complements
• Example: F=(A+B)•(A’+C), so F’=(A’•B’)+(A•C’)

A B C F A B C F’
0 0 0 0 0 0 0 1
0 0 1 0 0 0 1 1
0 1 0 1 0 1 0 0
0 1 1 1 0 1 1 0
1 0 0 0 1 0 0 1
1 0 1 1 1 0 1 0
1 1 0 0 1 1 0 1
1 1 1 1 1 1 1 0
Example of logic simplification
▪ Ex1: x+x’y = (x+x’) (x+y) distributive
=1.(x+y) complementary
=x+y
▪ Ex2: x(x’+y)= xx’+xy distributive
=0+xy complementary
=xy
▪ Ex3: xy+x’z+yz=xy+x’z+yz(x+x’)
complementary
=xy+x’z+xyz+x’yz distributive
=xy(1+z)+x’z(1+y)
=xy+x’z Null
One more example of logic simplification
▪ Example:
Z = A'BC + AB'C' + AB'C + ABC' + ABC

= A'BC + AB'(C’ + C) + AB(C' + C) distributive


= A'BC + AB’ + AB complementary
= A'BC + A(B' + B) distributive
= A'BC + A complementary
= BC + A absorption #2 Duality
(X •Y')+Y=X+Y with X=BC and Y=A
Boolean Analysis of Logic Circuits
• Boolean algebra provides a concise way to express the operation of a
logic circuit formed by a combination of logic gates
• so that the output can be determined for various combinations of
input values.
Boolean Expression for a Logic Circuit
▪ To derive the Boolean expression for a given logic circuit, begin at the
left-most inputs and work toward the final output, writing the
expression for each gate.

C CD
D
B+CD
B

A(B+CD)
A
Constructing a Truth Table for a Logic Circuit

▪ Once the Boolean expression for a given logic circuit has been
determined, a truth table that shows the output for all possible values
of the input variables can be developed.
▪ Let’s take the previous circuit as the example:
▪ A(B+CD)
▪ There are four variables, hence 16 (24) combinations of values are
possible.
Constructing a Truth Table for a Logic
Circuit
INPUTS OUTPUT
A B C D A(B+CD)
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 0
0 1 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 0
1 0 0 0 0
1 0 0 1 0
1 0 1 0 0
1 0 1 1 1
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1
Boolean Expression
▪ Any logic circuit, no matter how complex, can be
completely described using the three basic Boolean
operations: OR, AND, NOT.
▪ Example: logic circuit with its Boolean expression
Parentheses
▪ (Often needed to establish precedence;
sometimes used optionally for clarity)
▪ How to interpret A∙B+C?
▪ Is it A∙B ORed with C ?
▪ Is it A ANDed with B+C ?
▪ Order of precedence for Boolean algebra: AND before OR. Parentheses make the
expression clearer, but they are not needed for the case on the preceding slide.
▪ Note that parentheses are needed here :
Precedence
▪ First, perform all inversions of single terms
▪ Perform all operations with paretheses
▪ Perform an AND operation before an OR operation unless parentheses
indicate otherwise
▪ If an expression has a bar over it, perform the operations inside the
expression first and then invert the result
More Examples
Determining output level from a diagram

H.W: Determine the output for the condition where all inputs are
LOW.
Implementing Circuits From Boolean
Expressions
▪ When the operation of a circuit is defined by a Boolean expression, we
can draw a logic-circuit diagram directly from that expression.
Example
• Draw the circuit diagram to implement the expression
Review Question
• Draw the circuit diagram that implements the expression

Using gates having no more than three inputs.


Example
• Implement the logic circuit that has the expression using only NOR
and NAND gates
Example
▪ Determine the output level in last example for A=B=C=1 and D=0
Review Questions
▪ What is the only set of input conditions that will produce a HIGH
output from a three-input NOR gate?
▪ Determine the output level in last example for A=B=1, C=D=0
▪ Change the NOR gate at last example to a NAND gate, and change the
NAND to a NOR. What is the new expression for x?
Thank
You…

You might also like