Sei sulla pagina 1di 71

Digital Logic and Circuits

Dr. Vijay Kumar


BOOLEAN ALGEBRA
A set of rules to perform logical addition and multiplication

The basis of Boolean algebra lies in the operations of logical addition,


or the OR operation; and logical multiplication, or the AND operation.
Both of these find a correspondence in simple logic gates.

The variables in a Boolean, or logic, expression can take only one of


two values, usually represented by the numbers 0 and 1.

These variables are sometimes referred to as true (1) and false (0).
This convention is normally referred to as positive logic.

There is also a negative logic convention in which the roles of logic 1


and logic 0 are reversed.

9/18/2019 5
9/18/2019 6
Truth Table
Analysis of logic functions, that is, functions of logical (Boolean)
variables, can be carried out in terms of truth tables. A truth table is a
listing of all the possible values each of the Boolean variables can take,
and of the corresponding value of the function.

The rules that define a logic function are often represented in tabular
form by means of a truth table

9/18/2019 7
9/18/2019 8
9/18/2019 9
9/18/2019 10
NAND and NOR Gates

9/18/2019 11
UNIVERSAL GATES

Inverter using NAND AND using NAND

9/18/2019 12
UNIVERSAL GATES
Inverter using NOR AND using NOR

9/18/2019 13
XOR (Exclusive OR) Gate

XOR gate is used in half and full adder circuits


9/18/2019 14
Exercise:

9/18/2019 15
De Morgan’s theorems

9/18/2019 16
9/18/2019 17
The importance of De Morgan’s laws is in the statement of the duality
that exists between AND and OR operations: any function can be realized
by just one of the two basic operations, plus the complement operation.
This gives rise to two families of logic functions: sums of products and
product of sums.

Any logical expression can be reduced to either one of these two forms.
Although the two forms are equivalent, it may well be true that one of
the two has a simpler implementation (fewer gates).

9/18/2019 18
Sum of Products (SOP) and Product of Sums (POS)

A function can be written as a sum of minterms, which is referred to


as a minterm expansion or a standard sum of products.

A function can be written as a product of maxterms, which is


referred to as a maxterm expansion or a standard product of sums.

All possible minterms and maxterms of two variable truth table

9/18/2019 19
How to write a function
Minterms present in f (output function) correspond with the 1’s of f in
the truth table.

Maxterms present in f (output function) correspond with the 0’s of f in


the truth table.
output function

Proof: Z = X’Y + X (Y+Y’) = X’Y + X (1+Y)= X + Y(X+X’) = X+Y

9/18/2019 20
Example

Output can be
1or 0.

1 – is
represented by
product of
inputs.

0 – is
represented by
sum of inputs.

If the output is high for Row No. 3, 4, 5, 6, 7

What is the expression of logical function?


9/18/2019 21
Canonical Forms
Minterm
A B C Minterm
– Product (AND function)
0 0 0 0 m0 ABC
– Contains all variables
1 0 0 1 m1 ABC
– Evaluates to ‘1’ for a
2 0 1 0 m2 ABC
specific combination
3 0 1 1 m3 ABC
Example
4 1 0 0 m4 ABC
A=0 A B C
5 1 0 1 m5 ABC
B=0 (0) • (0) • (0)
6 1 1 0 m6 ABC
C=0
1 • 1 • 1=1 7 1 1 1 m7 ABC
Canonical Forms

Maxterm
A B C Maxterm
– Sum (OR function)
0 0 0 0 M0 A  B  C
– Contains all variables
1 0 0 1 M1 A  B  C
– Evaluates to ‘0’ for a
2 0 1 0 M2 A  B  C
specific combination
3 0 1 1 M3 A  B  C
Example
4 1 0 0 M4 A  B  C
A=1 A B C
5 1 0 1 M5 A  B  C
B=1 (1) + (1) + (1)
6 1 1 0 M6 A  B  C
C=1
0 + 0 + 0=0 7 1 1 1 M7 A  B  C
Canonical Forms

Truth Table to Boolean Function

A B C F F  ABC  ABC  ABC  ABC


0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 0
1 1 1 1
In SOP form

9/18/2019 25
Canonical Forms
Sum of Minterms
A B C F F
F  ABC  ABC  ABC  ABC 0 0 0 0 0 1
1 0 0 1 1 0
F  m1  m4  m5  m7
2 0 1 0 0 1
F   (1,4,5,7)
3 0 1 1 0 1
• Product of Maxterms 4 1 0 0 1 0
F  ABC  ABC  ABC  ABC 5 1 0 1 1 0
F  ABC  ABC  ABC  ABC 6 1 1 0 0 1
7 1 1 1 1 0
F  ABC  ABC  ABC  ABC
F  ( A  B  C )( A  B  C )( A  B  C )( A  B  C )
F  M0 M2 M3 M6
F   (0,2,3,6)
Standard Forms
Sum of Products (SOP)
AB(C  C )
 AB(1)
F  ABC  ABC  ABC  ABC
 AB
AC ( B  B)
 AC
BC ( A  A)
 BC
F  BC ( A  A)  AB(C  C )  AC ( B  B)

F  BC  AB  AC
Standard Forms
Product of Sums (POS)

AB(C  C )

F  ABC  ABC  ABC  ABC

BC ( A  A)

AC ( B  B)
F  AC ( B  B)  AB(C  C )  BC ( A  A)

F  AC  AB  BC
F  ( A  C )( A  B)( B  C )
Two - Level Implementations

Sum of Products (SOP)


B’
C

F  BC  AB  AC A
B’ F
Product of Sums (POS) A
C
A
C
A
F  ( A  C )( A  B)( B  C ) B’ F
B’
C
9/18/2019 30
Proof

X + X.Y = X (Y+Y’) + XY = XY +XY’ + XY = XY + XY’ = X


or

X’ + X.Y = X’ (1+Y) + XY = X’ +X’Y + XY = X’ + Y

9/18/2019 31
Exercise:

9/18/2019 32
Exercise:

Simplify:

9/18/2019 33
Exercise:

Simplify

F= ABC’ + AB’C + A’BC + ABC

Since X+X = X, ABC can be repeated many times

= ABC’ + ABC + AB’C + ABC + A’BC+ABC


= AB(C’+C) + AC(B’+B) + BC(A’+A)
= AB+ AC+BC

9/18/2019 34
Exercise:

1.

2.

9/18/2019 35
Exercise in Boolean Algebra

1. Determine the logic expression for the output Y, from the truth table
shown. Simplify and sketch the logic circuit for the simplified expression.

2. Prove the following Boolean identity :

9/18/2019 36
3. Simplify the following Boolean expression and draw the logic circuits
for the simplified expressions.

(a) (ABC+ABC+ABC+BC ) (b) B(A+C)+C(A+B)+AC


(c) (AB + C) (AB + D)

a)

a) B+AC

b) C+AB’

c) AB+CD

9/18/2019 37
Exercise:

Simplify

F= ((AB)’ + (AC)’)’

Using De Morgan’s Theorem


F= ((AB)’ + (AC)’)’
= (AB)’’ . (AC)’’
= (AB).(AC)
= A.B.C

9/18/2019 38
Exercise:

Simplify

1) F= (A+B).(A+B)’ = 0

2) F= A.B + (A.B)’ = 1

3) F= (A+B.C’).(A+B.C’) =A+B

9/18/2019 39
Exercise in Boolean Algebra

4. Design a logic circuit whose output is HIGH only when a majority of


the inputs A, B and C are HIGH.

5. Determine the Boolean expression for the logic circuit shown in Fig.
Simplify the Boolean expression using Boolean Laws and De Morgan’s
theorem. Redraw the logic circuit using the simplified Boolean
expression.

9/18/2019 40
Minimization Technique
Logic Minimization: reduce complexity of the gate level implementation

• reduce number of literals (gate inputs)

• reduce number of gates

• reduce number of levels of gates

 KARNAUGH MAP (K-Map)

 TABULATION METHOD
(Quine-McCluskey Method)

9/18/2019 41
Karnaugh map
The Karnaugh map (or simply a K-map) is similar to a truth table because it presents
all the possible values of input variables and the resulting output for each value.

The K-map is an array of squares (or cells) in which each square represents a binary
value of the input variables.

The number of squares in a Karnaugh map is equal to (2n) the total number of
possible input variable combinations (i.e number of squares is equal to the number of
rows in a truth table).

Indicate the input variables along the sides of the K-map. The binary values of input
variables are arranged based on gray code.

Ex. for two variables, the number of square is 22 = 4, for three variables, the
number of squares is 23 = 8 and for four variables, the number of squares is 24 = 16.
Truth Table K-map

A B Z Minterm
0 0 0 A’B’
0 1 1 A’B
1 0 1 AB’
9/18/2019 1 1 1 AB 42
Manual Logic reduction K-map

Disadvantages: Advantages:

 Finding the suitable pair of terms is  In every two adjacent cells, one of the
difficult. variables has 1 and 0.
 If the suitable terms are not paired, it  All minterms which differ by one
will lead to long reduction process. variable are in adjacent cells.
 Through grouping, the changing
variable mapped by the loop can be
eliminated.

9/18/2019 43
Two, Three and Four variable Karnaugh map and Minterms

9/18/2019 44
2-variable K-map 3-variable K-map

0 1

2 3

4-variable K-map

9/18/2019 45
Procedure in K-map

Step-1: Find the number of variables

Ex.

Step-2: Find the cells in K-map corresponding to the minterms. Enter 1’s
in that cells.

000 010 101 100 Binary value of input variables


corresponding to the Minterms
0 2 5 4 Cell number

Step-3: Group 1’s in the adjacent cells. Look for largest possible loop.
(8 cell, 4 cell, 2 cell).

Step-4: Form minimum number of loops.

Step-5: Write the reduced function from the K-map.

9/18/2019 46
Rules for Grouping adjacent cells containing ones

1.No zeros allowed.


2.No diagonals.
3.Only power of 2 number of cells in each group.
4.Groups should be as large as possible.
5.Every one must be in at least one group.
6.Overlapping allowed.
7.Wrap around allowed.
8.Number of groups must be as fewer as possible.

9/18/2019 47
Rules for Grouping adjacent cells containing ones

1. Groups may not include any cell containing a zero

2. Groups may be horizontal or vertical, but not diagonal.

9/18/2019 48
3. Groups must contain 1, 2, 4, 8, or in general 2n cells.

That is if n = 1, a group will contain two 1's since 21 = 2.


If n = 2, a group will contain four 1's since 22 = 4.

9/18/2019 49
4. Each group should be as large as possible.

5. Each cell containing a one must be in at least one group

9/18/2019 50
6. Groups may overlap.

7. Groups may wrap around the table. The leftmost cell in a row may be grouped with
the rightmost cell and the top cell in a column may be grouped with the bottom cell.

9/18/2019 51
8. There should be as few groups as possible, as long as this does not contradict any of
the previous rules.

9/18/2019 52
Writing the logic function after grouping
Write the mintems corresponding to each loop by omitting the changing
variables.
for example A is a changing variable in red loop

9/18/2019 B’D’ 53
Mapping a Standard SOP Expression on the Karnaugh Map

9/18/2019 54
Mapping a Nonstandard SOP Expression on the Karnaugh Map

(Factorizing)

9/18/2019 55
Exercise:
Simplify the following SOP expression using the Karnaugh mapping
procedure :

9/18/2019 56
9/18/2019 57
Exercise:

Write the logic functions from the K-map

9/18/2019 58
Exercise:
Shows a Karnaugh map of a sum-of-products (SOP) function. Determine
the simplified SOP function.

9/18/2019 60
9/18/2019 61
Mapping Directly on Karnaugh Map from a Truth Table
Exercise:
Implement the following Boolean expression using minimum number of 3-
input NAND gates.

9/18/2019 62
9/18/2019 63
Exercise:

Consider a logic circuit with 4 input variables in which the output is high
when at least 3 inputs are high. Reduce the logic function using K-map.

9/18/2019 64
Exercise: Reduce the expression F = Σm(0,1,2,3,6,7,13,15) by mapping and
implement in NAND logic.

Enter 1 for given minterms in corresponding location and 0 for others.


Group the maximum number of 1s in the order of 2n.
Ensure that all the 1s must come under at least once in a group.
Simplify the resultant minterms using basic laws and OR the Result.
Implement the hardware.

CD 00 01 11 10
AB
Group I = A’B’C’D’ A’B’C’D A’B’CD A’B’CD’
00 1 1 1 1 = A’B’
0 1 3 2

1 Group II = A’BCD A’BCD’ A’B’CD A’B’CD’


01 0 4 05 1 = A’C
7 6
Group III = ABC’D ABCD
0 1 1 0 = ABD
11 12 13 15 14
F = A’B’+A’C+ABD
10 0 8 0 9 011 010
9/18/2019 65
NAND Implementation

A’
B’

A’ F = A’B’+A’C+ABD

A
B
D

9/18/2019 66
1. Simplify the Boolean function
F(x, y, z) = (0, 2, 4, 5, 6)

Ans: Z’+XY’

2. Given the following Boolean function:


F = A'C + A'B + AB'C + BC
(a) Express it in sum of minterms,
(b) Find the minimal sum of products expression,

The function can be expressed in sum of


min terms form: F(A, B, C) = (1, 2, 3, 5, 7)

A ‘C + A 'B + AB'C + BC = C + A 'B

9/18/2019 67
Exercise:
Simplify the Boolean function

F(w, x, y, z)=  (0,1,2,4,5,6,8,9,12,13,14)

yz
wx 00 01 11 10
0 1 3 2
00

4 5 7 6
01

12 13 15 14
11

8 9 11 10
10

Ans: y' + w'z' + xz'


9/18/2019 68
Exercise:

Simplify the Boolean function

F = A'B'C' + B'CD' + A'BCD' + AB'C'


CD
AB 00 01 11 10
0 1 3 2
00

4 5 7 6
01

12 13 15 14
11

8 9 11 10
10

9/18/2019 69
Exercise: Simplify the following Boolean functions

1. F(A, B, C, D) = (0, 2, 3, 5, 7, 8, 9,10,11,13,15)

CD 2. F(A, B, C, D) = (0,1,2,5,8,9,10)
AB 00 01 11 10
0 1 3 2 CD
00 1 1 1 AB 00 01 11 10
0 1 3 2
4 5 7 6 00 1 1 1
01 1 1
4 5 7 6
11 13 15 14 01 1
11 1 1
11 13 15 14
8 9 11 10 11
10 1 1 1 1
8 9 11 10
10 1 1 1
F = BD + B' D' + CD + AD
= BD + B' D' + CD + AB'
= BD + B' D' + B' C + AD
= BD + B' D' + B' C + AB' F = B'D' + B'C' + A'C'D

9/18/2019 70
Exercise:

CD
AB 00 01 11 10
0 1 3 2
00 1 1 1

4 5 7 6
01 1 1 1

12 13 15 14
11 1 1

8 9 11 10
10 1 1 1

9/18/2019 71
Exercise:

CD
AB 00 01 11 10
0 1 3 2
00

4 5 7 6
01

12 13 15 14
11

8 9 11 10
10
9/18/2019 72

Potrebbero piacerti anche