You are on page 1of 217

CSE1003-Digital Logic and

Design
MAHESWARI.R

1
Text Book

M. Morris Mano and Michael D.Ciletti


Digital Design: With an introduction to
Verilog HDL, Pearson Education 5th
Edition- 2014.

2
INTRODUCTION

3
Digital ?

4
Number System

Number system
Base or radix-basic symbol for the number system
Number Base Range
system
Binary 2 0 to 1
Decimal 10 0 to 9
Octal 8 0 to 7
Hexadecimal 16 0 to F

5
Decimal to binary conversion with and without decimal point
Example 1:

6
Example 2:

7
Decimal 25 to Binary system

8
Decimal to octal conversion:

9
Decimal to hexadecimal conversion:

10
A system takes decimal
input 154.9034 and
encrypt the information in
Octal form and send it to
Module 1, in Binary form
to Module 2 and
Hexadecimal form
To Module 3
11
Binary to decimal conversion:
The weights of Binary Number System are given as follows,

24 23 22 21 20

12
Octal to decimal conversion:
The weight of digital position in octal number is as follows,

13
Hexadecimal to decimal conversion:

14
Octal to binary conversion
Base of octal ? 8

How to express 8 in terms of 2 (Binary)


3
2
To convert Octal to Binary replace each
octal bit into corresponding binary bit (3
bit) from decimal point .

15
Octal to binary conversion:
Example:

Binary to octal conversion:


Example:

16
Hexa to binary conversion
Base of Hexa ? 16

16
How to express 4 in terms of 2 (Binary)
2

To convert Hexa to Binary replace each


hexa bit into corresponding binary bit (4
bit) from decimal point .

17
Hexadecimal to binary conversion:
Example:

Binary to hexadecimal conversion:


Example:

18
Binary to Octal conversion
To convert Binary to Octal divide the
sequence into 3 bits and replace the
corresponding octal number from decimal
point .
101111.011100 ?

19
Binary to Hexa conversion
To convert Binary to Hexa divide the
sequence into 4 bits and replace the
corresponding hexa number from decimal
point .
101111.011100 ?

20
Test your knowledge
1. The largest decimal number that can be
represented in binary with four bits
24 -1 = 15
2. The weight of the 1 in the binary number
1000
2 =83

21
Complements

Ones Complement
Twos Complement
Ones Complement 0 to 1 and 1 to 0

Ex: 1100 0011

22
Diminished Radix Complement (r-1)s Complement Cntd..

Binary Number:

1. 1s complement of (101100)2 Here r=2, n=6 and N=101100


1s Complement : (rn -1)- N
Formula: (26-1)-101100= (010100)2

OR

All 0s become 1s
All 1s become 0s

Example (10110000)2
(01001111)2

If you add a number and its 1s complement


9s complement of 546700 :
999999 - 546700 = 453299
Radix Complement

The rs complement of an ndigit number N


in base r is defined as r n - N for N !=0 and
as 0 for N = 0
Comparing with the (r - 1)s complement,
rs complement is obtained by adding 1 to
the (r - 1)s complement:
r n - N =[(r n - 1) - N] + 1
the 10s complement of decimal 2389 is
7610 + 1 = 7611 (adding 1 to the 9s
complement value).

Twos complement :

Take ones complement and add one to LSB


1001 0110
1
------
0111
27
The complement of the complement
restores the number to its original value
Subtraction with rs complement

Subtraction of M-N(M:Minuend and N:


Subtrahend) of both base r is,

1. Add the M to rs complement of N


2. See the result for an end carry
i) If end carry, discard it
ii) else take rs complement of the result and
place a negative
sign in front.
Subtraction with rs complement

Example:
1. (72532-3250)10
72532
10s complement of 03250 + 96750
-----------------------------------------------------------------------------
1 69282

Red indicates the carry and discard it, Ans: 69282


Example: 2

No carry, so take 10s complement of ans and add - at the front

Ans = -69282
Discard the carry, Ans= 0010001

No carry, Take 2s complemnt of Sum and add in front

Ans= -0010001
Subtraction with (r-1)s complement

Subtraction of M-N(M:Minuend and N: Subtrahend) of


both base r is,

1. Add the M to (r-1)s complement of N


2. See the result for an end carry
i) If end carry, add 1 to the LSB bit of
the answer( end around carry)
ii) else take (r-1)s complement of the
result and place a negative sign in front.
Subtraction with (r-1)s complement Cntd
Binary Codes
A binary code is a system for encoding data made up of 0s and 1s.

Whenever information needs to be digitally transmitted from


one location to another, a binary code is used.

The binary code can be used for representing the number as well as
alpha numeric letters.
Binary Codes Ctd
To represent a group of 2n distinct elements in a binary code
requires a minimum of n bits.
i.e arrange n bits in 2n distinct ways.

Example: A group of 8 element requires 3-bit code(000 to 111)

When the no. of elements to be coded is not power of 2 then


some bit combinations are unassigned.
Binary Codes Ctd
Decimal Codes
Binary code for decimal digits require minimum of 4-bits. Different binary
codes for decimal digit given below.
The 2421 code is the same as that in
BCD from 0 to 4; however, it varies
from 5 to 9.
This is also a self-complementary
code, that is, the 9s complement of
the decimal number is obtained by
changing the 1s to 0s and 0s to 1s.
Binary-Coded Decimal (BCD)
Binary-Coded Decimal is a weighted code. It is possible to assign
weights to the binary bits according to their positions.
The weights for the BCD bits are 8, 4, 2, and 1, and for this reason the
code is sometimes called the 8421 code.

Example:
BCD is 0110. Write the decimal equivalent

0x8+1x4+1x2+0x1=6
Binary-Coded Decimal (BCD)
Decimal to BCD
25 0010 0101
??
89
67
13

41
Warning: Conversion or Coding?

Do NOT mix up conversion of a decimal number to a binary


number with coding a decimal number with a BINARY CODE.
1310 = 11012 (This is conversion)
13 0001|0011 (This is coding)
BCD Addition

When the binary sum is equal to or


less than 1001 (without a carry), the
corresponding BCD digit is correct.
when the binary sum is greater than or
equal to 1010, the result is an invalid BCD
digit.
The addition of 6 = (0110) to the binary
sum converts it to the correct digit and
also produces a carry as required.
This is because a carry in the most
significant bit position of the binary sum
and a decimal carry differ by 16 - 10 = 6.
Example:
Gray Code
Gray Code

- adjacent numbers have a single digit differing by 1.


( a number changes by only one bit as it
proceeds from one number to the next.)

Application:
used in labeling the axes of Karnaugh maps
When Gray codes are used in computers to
address program memory, the computer uses less
power because fewer address lines change as the
program counter advances.
power consumption and decoding logic is less
Conversion of a Binary Number into Gray Code
Any binary number can be converted into equivalent Gray code by the
following steps:

(i) the MSB of the Gray code is the same as the


MSB of the binary number;

(ii) the second bit next to the MSB of the Gray


code equals the Ex-OR of the MSB and second bit
of the binary number; it will be 0 if there are
same binary bits or it will be 1 for different
binary bits;

(iii) the third bit for Gray code equals the


exclusive-OR of the second and third bits of the
binary number, and similarly all the next lower
order bits follow the same mechanism.
Convert (101011)2 into Gray code
Convert (564)10 into Gray code.
Conversion of Gray Code into a Binary Number
Any Gray code can be converted into an equivalent binary number by
the following steps:

(i)the MSB of the binary number is the same as the MSB of


the Gray code;

(ii)the second bit next to the MSB of the binary number


equals the Ex-OR of the MSB of the binary number and
second bit of the Gray code; it will be 0 if there are
same binary bits or it will be 1 for different binary bits;

(iii) the third bit for the binary number equals the
exclusive-OR of the second bit of the binary number and
third bit of the Gray code, and similarly all the next lower
order bits follow the same mechanism.
Convert the Gray code 101101 into a binary number.
ASCII character Code
American Standard Code for Information Interchange
This code is a popular code used to represent information sent as
character-based data.

ASCII properties:

Digits 0 to 9 span Hexadecimal values 3016 to 3916


Upper case A-Z span 4116 to 5A16
Lower case a-z span 6116 to 7A16
ASCII character Code

97=(1100001)2 a, 65=(1000001)2
Error Detecting Code
Errors can occur data transmission. They should be detected, so that
re-transmission can be requested.

Parity bit.
Even parity: additional bit supplied to make total number of
1s even.
Odd parity: additional bit supplied to make total number of
1s odd.

Parity generation unit in sender side will supply the parity bit
and the parity check unit in receiving side will detect the error
in the received message.
Integrated Circuit
- flat and DIP Package
- SSI, MSI, LSI, VLSI

Representation and manipulation of


switching circuits
- representation of AND and OR logic
Boolean Algebra
Boolean algebra is an algebraic structure defined by a set of
elements,together with two binary operators + and .

Boolean algebra is a mathematical system for the manipulation


of variables that can have one of two values.
In formal logic, these values are true and false.
In digital systems, these values are on and off, 1 and 0,
or high and low.

Boolean expressions are created by performing operations on


Boolean variables.
Common Boolean operators include AND, OR, and NOT.
3.2 Boolean Algebra
Boolean Algebra
A Boolean operator can be completely
described using a truth table.
The truth table for the Boolean operators
AND and OR are shown at the right.
The AND operator is also known as a
Boolean product. The OR operator is the
Boolean sum.

60
3.2 Boolean Algebra
Boolean Algebra

The truth table for the Boolean


NOT operator is shown at the right.
The NOT operation is most often
designated by an overbar. It is
sometimes indicated by a prime
mark ( ).

61
Boolean Algebra

A Boolean function has:


At least one Boolean variable,
At least one Boolean operator, and
At least one input from the set {0,1}.
It produces an output that is also a member of the
set {0,1}.
3.2 Boolean Algebra
Boolean Algebra
The truth table for the Boolean
function:

is shown at the right.


To make evaluation of the
Boolean function easier, the truth
table contains extra (shaded)
columns to hold evaluations of
subparts of the function.

63
3.2 Boolean Algebra
Boolean Algebra
As with common arithmetic,
Boolean operations have rules
of precedence.
The NOT operator has highest
priority, followed by AND and
then OR.
This is how we chose the
(shaded) function subparts in
our table.

64
3.2 Boolean Algebra
Boolean Algebra
Digital computers contain circuits that implement
Boolean functions.
The simpler that we can make a Boolean function,
the smaller the circuit that will result.
Simpler circuits are cheaper to build, consume
less power, and run faster than complex
circuits.
With this in mind, we always want to reduce our
Boolean functions to their simplest form.
There are a number of Boolean identities that help
us to do this.

65
3.2 Boolean Algebra
Boolean Algebra : Properties
Most Boolean identities have an AND (product) form as well as an
OR (sum) form. We give our identities using both forms. Our first
group is:

Dominance OR Null Law X+1=1 , X.0=0


66
3.2 Boolean Algebra
Boolean Algebra : Properties
Our second group of Boolean identities should be
familiar to you from your study of algebra:

67
3.2 Boolean Algebra
Boolean Algebra : Properties
Our last group of Boolean identities are perhaps the
most useful.

68
Boolean Algebra : Properties
Proof for Absorption
x+xy = x
x+xy = x.1+xy
= x(1+y)
= x.1
=x
Can also be proved using truth table method

x y xy x+xy
0 0 0 0
0 1 0 0
1 0 0 1
1 1 1 1
Boolean Algebra : Properties

Proof for De Morgans Law

x y x+y (x+y) x y xy
0 0 0 1 1 1 1
0 1 1 0 1 0 0
1 0 1 0 0 1 0
1 1 1 0 0 0 0

(x+y) = xy DeMorgans Theorem


(xy) = x +y DeMorgans Theorem
Boolean Function Proof

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

x y z Y+z x.(y+z) x.y x.z (x.y)+x.z


0 0 0 0 0 0 0 0
0 0 1 1 0 0 0 0
0 1 0 1 0 0 0 0
0 1 1 1 0 0 0 0
1 0 0 0 0 0 0 0
1 0 1 1 1 0 1 1
1 1 0 1 1 1 0 1
1 1 1 1 1 1 1 1
3.2 Boolean Algebra
Boolean Function Simplification
We can use Boolean identities to simplify the
function:
as follows:

72
Solution:
F(X,Y,Z)=(X+Y)(Y+Z)
Solution
Given, F(X,Y,Z)=(X+Y)(X+Z)

F(X,Y,Z)=X.X+X.Z+Y.X+Y.Z [Applying distributive Rule]

F(X,Y,Z)=X+X.Z+Y.X+Y.Z [Applying Idempotent Law]

F(X,Y,Z)=X(1+Z)+Y.X+Y.Z [Applying distributive Law]

F(X,Y,Z)=X+Y.X+Y.Z [Applying dominance Law]

F(X,Y,Z)=(X+1).X+Y.Z [Applying distributive Law]

F(X,Y,Z)=1.X+Y.Z [Applying dominance Law]

F(X,Y,Z)=X+Y.Z [Applying dominance Law]

F(X,Y,Z)=X+YZ is the minimized form.


Operator Precedence
1.( )
2.NOT
3.AND
4.OR
x y x y

xy xy xy

xy

VENN DIAGRAM FOR TWO VARIABLES VENN DIAGRAM ILLUSTRATION X=XY+X

x x y
y

z z

x+(y+z) xy+xz

VENN DIAGRAM ILLUSTRATION OF THE DISTRIBUTIVE LAW


Boolean Functions

Boolean function is an expression formed with binary variables, two binary


operators OR and AND, unary operator NOT, parenthesis and equal sign.

For the given value of the variables the function can be either 0 or 1.

Boolean function represented as an algebraic expression.

Example of Boolean function or expression:


f(x,y,z) = (x + y)z + x

Notations:

f is the name of the function


(x,y,z) are the input variables each representing 1 or 0.
Boolean Functions
Boolean function can be represented in truth table.
With n variables there are 2n input combinations, to represent a function
in truth table.

TRUTH TABLE FOR F1=xyz, F2=x+yz, F3=xyz+xyz+xy and F4=xy+xz

x y z F1 F2 F3 F4
0 0 0 0 0 0 0
0 0 1 0 1 1 1
0 1 0 0 0 0 0
0 1 1 0 0 1 1
1 0 0 0 1 1 1
1 0 1 0 1 1 1
1 1 0 1 1 0 0
1 1 1 0 1 0 0
Boolean Functions to Logic Gates

Boolean function can be transformed from an algebraic expression into a


Circuit diagram composed of logic gates.

Logic circuit for F1


Boolean Functions to Logic Gates

Logic circuit for F2


Boolean Functions to Logic Gates

By manipulating Boolean expression according to the rules of


Boolean algebra we could find simpler solution.
Thus reduce the number of gates.
Complement of Boolean Function
- use Demorgans law

Example:
To Work out:
Simplify the following Boolean Functions

1. x(x+y)
2. X+xy
3. (x+y)(x+y)
4. Xy+xz+yz
5. Complement function of F1 and F2
F1= xyz+xyz
F2= x(yz+yz)
To Work out: With Solution
Canonical and Standard Forms

Sum of Products (SOP)

Product of Sums (POS)


SOP & POS
Logical Gates
Basic Digital logic is based on 3 primary
functions (the basic gates):

AND

OR

NOT
95
The AND function
The AND function:
If all the inputs are high is the output is high
If any input is low, the output is low

If this input AND this input are high, the


output is high

96
AND Logic Symbol

Inputs Output

If both inputs are 1, the output is 1

If any input is 0, the output is 0

97
AND Logic Symbol

0
Inputs 0 Output

0
Determine the output

Animated Slide

98
AND Logic Symbol

0
Inputs 0 Output

1
Determine the output

Animated Slide

99
AND Logic Symbol

1
Inputs 1 Output

1
Determine the output

Animated Slide

100
AND Truth Table
To help understand the function of a digital
device, a Truth Table is used:
Input Output
Every possible
input combination 0 0 0
0 1 0
1 0 0
1 1 1
AND Function

101
AND Gates
It is possible to have AND gates with more
than 2 inputs. The same logic rules apply
if any input

102
The OR function
The OR function:
if any input is high, the output is high
if all inputs are low, the output is low

If this input OR this input is high, the


output is high

103
OR Logic Symbol

Inputs Output

If any input is 1, the output is 1

If all inputs are 0, the output is 0

104
OR Logic Symbol

0
Inputs 0 Output

0
Determine the output

Animated Slide

105
OR Logic Symbol

0
Inputs 1 Output

1
Determine the output

Animated Slide

106
OR Logic Symbol

1
Inputs 1 Output

1
Determine the output

Animated Slide

107
OR Truth Table
Truth Table

Input Output
0 0 0
0 1 1
1 0 1
1 1 1
OR Function

108
The NOT function
The NOT function:
If any input is high, the output is low
If any input is low, the output is high

The output is the opposite state of the


input

The NOT function is often called


INVERTER 109
NOT Logic Symbol

Input Output

If the input is 1, the output is 0

If the input is 0, the output is 1

110
NOT Logic Symbol

Input 0 1
Output

Determine the output

Animated Slide

111
NOT Logic Symbol

Input 1 0
Output

Determine the output

Animated Slide

112
NOT Truth Table
Truth Table

Input Output
0 1
1 0

NOT Function

113
Universal Gates-NAND and NOR gates are universal gates.

NAND gate:
AND followed by an inverter

Truth table for NAND

114
NOR gate
OR gate followed by an inverter

Truth table:

115
XOR gate:
The Boolean expression of the XOR gate is

Truth table:

116
DIGITAL LOGIC GATES
NAME GRAPHIC ALGEBRIC TRUTH
SYMBOL FUNCTION TABLE

AND F=XY X Y F
X 0 0 0
F
Y 0 1 0
1 0 0
1 1 1

OR F=X+Y X Y F
0 0 0
X
F 0 1 1
Y
1 0 1
1 1 1
NAME GRAPHIC ALGEBRIC TRUTH
SYMBOL FUNCTION TABLE
Inverter X F
0 1
X F F=X 1 0

Buffer X F
0 0
X F F=X 1 1

X Y F
X F 0 0 1
NAND Y F=(XY)
0 1 1
1 0 1
1 1 0
NAME GRAPHIC ALGEBRIC TRUTH
SYMBOL FUNCTION TABLE
X Y F
X 0 0 1
NOR Y F F=(X+Y) 0 1 0
1 0 0
1 1 0

X Y F
Exclusive-OR X F F=XY+XY 0 0 0
Y
(XOR) =XY 0 1 1
1 0 1
1 1 0

Exclusive-NOR X Y F
or X F 0 0 1
Y F=XY+XY
Equivalence 0 1 0
=X Y
1 0 0
1 1 1
(X+Y)
x
[Z+(X+Y)]
Y (X Y) Z=(X+Y) Z
=XZ+YZ
Z

X (X ( Y Z)=X(Y+ Z)

=XY+XZ
[X+(Y+Z)]
(Y+Z)
Y
Z

Demonstrating the nonassociativity of the NOR operator


(X Y) Z X (Y Z)
X X (XYZ)
(X+Y+Z) Y
Y
Z Z

(a) There input NOR gate (b) There input NAND gate

A
B
C

F=[(ABC). (DE)]=ABC+DE

D
E
(c) Cascaded NAND gates

Multiple-input AND cascaded NOR and NAND gates


TRUTH TABLE
X
Y X Y Z F
0 0 0 0 1
0 0 1 1 0
Z F=X Y Z 0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
(a) Using two input 1 1 0 0 1
gates 1 1 1 1 0

X XOR
Y F=X Y Z
Z
XNOR
(b) Three input gates Odd
functio
n
Even
(b) Three input exclusive OR gates functio
n
IC DIGITAL LOGIC FAMILIES
TTL Transistor- Transistor Logic
Very popular logic family.
It has a extensive list of digital functions.
It has a large number of MSI and SSI devices, also has LSI devices.

ECL Emitter Coupled Logic


Used in systems requiring high speed operations.
It has a large number of MSI and SSI devices, also LSI devices.
MOS Metal-Oxide Semiconductor
Used in circuit requiring high component density
It has a large number of MSI and SSI devices, also LSI devices
(mostly)
CMOS Complementary MOS
Used in systems requiring low power consumption.
It has a large number of MSI and SSI devices, also has LSI devices.
I2L Integrated - Injection Logic
Used in circuit requiring high component density.
Mostly used for LSI functions
Some Typical IC
Gates
VCC VCC
14 13 12 11 10 9 8 14 13 12 11 10 9 8

1 2 3 4 5 6 7 1 2 3 4 5 6 7
GND GND

7404 Hex Inverters 7400 Quadruple 2-input


NAND gates

TTL gates
(3-15 V)
VDD NC

14 13 12 11 10 9 8

C MOS
GATES

1 2 3 4 5 6 7
NC Vss
(GND)
4002 dual 4 input NOR gates
NC NC

16 15 14 13 12 11 10 9

CMOS
GATES
1 2 3 4 5 6 7 8 Vss
VDD (GND)
(3-15 V)

4050 Hex buffer


Logic gates

AND gate:

OR gate:
NOT gate:

NAND and NOR gates are universal gates.


NAND gate: Truth table for NAND
AND followed by an inverter
NOR gate
OR gate followed by an inverter

Truth table:
NAND gate as universal logic element
-used to produce NOT, AND, OR and NOR functions

130
131
NOR gate as universal logic element
-used to produce NOT, AND, OR and NAND functions

132
NOR gate as universal logic element
-used to produce NOT, AND, OR and NAND functions

133
Implementing Boolean Expressions Using NAND Gates
-expression should be in SOP form

Example: Y= A B C + D E + F

Using AND-OR

134
135
Using NAND-NAND

Using NAND-Bubbled OR

136
Implementing Boolean Expressions Using NOR Gates
-expression should be in POS form

Example: Y= (A + B +C) (D + E) F

Using OR-AND

137
Using NOR-NOR

Using NAND-Bubbled OR

138
Dual symbol:
NAND symbol and Negative-OR symbol or
NOR symbol and Negative-AND symbol

NAND Logic for AB+CD

Solve the NAND logic diagram

139
Exercise to implement 1.(ABC+DE) and (ABC+D+C) using NAND gates

NOR gate logic for (A+B)(C+D)

Solve the NAND logic diagram

140
Test your knowledge
1. (1101101) 2 ( )10 10910

2. (0.5625 )10 ( )2
1001 2

100101002
3. (148)10 ( ) 2

61C16
4. (1 1 0 0 0 0 1 1 1 0 0) ( ) 16

141
Test your knowledge
5. (1 E 9 C) 16 ( ) 2
(0001 1110 1001 1100)2

6. (156410) 10 ()(12 1 0 0 0 0 1 1 1 0 0)2

142
Test your knowledge
digital
1. A(n) device works with discrete
numbers, whereas a(n)
analog
device works with continuous data.
2. The binary
number system represents
numeric data as a series of 0s and 1s.

143
Combinational Circuits

Logical expressions are implemented by


connecting specific logic gates.
These logic gates produce a specific output
for certain specified combinations
of input variables, with no storage
involved. These circuits are commonly
known as combinational circuits.

144
K-Map : K stands for
Karnaugh
Maurice Karnaugh developed K-Maps in
the 1950s.

These maps provided an alternate way


of representing Boolean functions.

145
Combinational Circuits
Logical expressions are implemented by connecting specific logic gates.
These logic gates produce a specific output for certain specified combinations
of input variables, with no storage involved. These circuits are commonly
known as combinational circuits.

Karnaugh Map:
-provides a systematic method for simplifying Boolean expression.
-to produce simplest SOP/POS/minimum expression

Simplification of Boolean equation using Karnaugh Maps


to reduce the gate count
less power consumption
circuit works faster
low cost
to simplify logic expressions
K-Map
A Kmap is a matrix consisting of rows and
columns that represent the output values of a
Boolean function.
The output values placed in each cell are
derived from the minterms of a Boolean function.
A minterm is a product term that contains all of
the functions variables exactly once, either
complemented or not complemented.

147
Minimization Technique:
Expression should be in canonical form
Adjacent 1s are combined by unifying theorem X+X=1
Note:
Canonical Form:
When each term of a logic expression contains all variables,
its said to be in the canonical form.
Minterm:
When a sum of products form of logic expression is in canonical form,
each product term is called minterm. Each minterm contains all variables.
Example: AB+AB'+A'B(2-variables)
Determining the minimum SOP expression from the Map:
1. Group the cells
A group must contain 1,2,4,8 or 16 cells
adjacency
Group must be as large as possible.
Every square containing 1 must be considered at least once
2. Determine the minimum product term for each group
For a 3-variable map:
1. A 1-cell group yields a 3-variable PT
2. A 2-cell group yields a 2-variable PT
3. A 4-cell group yields a 1-variable PT
4. A 8-cell group yields a value 1
For a 4-variable map:
1. A 1-cell group yields a 4-variable PT
2. A 2-cell group yields a 3-variable PT
3. A 4-cell group yields a 2-variable PT
4. A 8-cell group yields a 1-variable PT
5. A 16-cell group yields a value 1

3. When all the minimum PT are derived, they are


summed to form the minimum SOP expression
Example
2- Variable min term

m0 m1 m2 m3

151
3- Variable min term
A three-variable function, such as f(x,y,z),
has 23 = 8 minterms:
xyz xyz xyz xyz
xyz xyz xyz xyz

152
K-Map Breakdown
How the inputs of the circuit determine
the size of the K-Map

153
For a 4-variable map:

1. A 1-cell group yields a 4-variable PT (Product


Term)
2. A 2-cell group yields a 3-variable PT
3. A 4-cell group yields a 2-variable PT
4. A 8-cell group yields a 1-variable PT
5. A 16-cell group yields a value 1

When all the minimum PT are derived, they are summed


to form the minimum SOP expression

154
The rules of Kmap simplification are:

Groupings can contain only ___; no ___s.


Groups can be formed only at ___; diagonal
groups are not allowed.
The number of 1s in a group must be a power
of ___. 1,2,4,8 ,16
The groups must be made as ___ as
possible.
Groups can ___ and ___ around the sides of
the Kmap.
155
155
Groupings can contain only 1s; no 0s.
Groups can be formed only at right angles;
diagonal groups are not allowed.
The number of 1s in a group must be a power
of 2.
The groups must be made as large as
possible.
Groups can overlap and wrap around the
sides of the Kmap.

156
Expression should be in canonical form
Canonical Form:
When each term of a logic expression
contains all variables, its said to be in the
canonical form.

157
4-Variable K-Map:

There are 16 cells in the map.

Example for 4-variable K-Map(W,X,Y,Z)

158
Mapping the following SOP in K-Map:
BC+AB+ABC+ABCD+ABCD+ABCD\

First expand the terms,


BC AB ABC
0000 1000 1100
0001 1001 1101
1000 1010
1001 1011

Other terms as in the SOP,


Each of the above binary values
are mapped to K-map.

159
An Digital kit contains 1 led with four switches like
S3,S2,S1,S0 . The leds will glow with the following
conditions of the switches.

Switches (S0,S1,S2,S3) remain as follows:


The minterm of the function F1 is identified by the
presence of exactly 2 times occurrence of 1 and
exactly 3 times occurrence of 0 in a 4 bit data
sequence .Simplify the function F1 to its minimum
SOP form by using a K-Map.
i). Without Dont care
ii) With Dont care d(12,13,14,15)
Example to group the ones in 4-variable K-Map

161
162
Determine the minimum SOP expression :

Example: F(A,B,C,D)=(2,3,4,5,6,7,9,12,13,14,15)

Minimum SOP:

163
Other examples:

164
Dont Care

Functions that have unspecified outputs for


some input combinations are called incompletely specified
functions.

In most applications, we simply dont care what value is assumed


by the function for the unspecified minterms.

For this reason, it is customary to call the unspecified minterms of


a function dont-care conditions.

These dont-care conditions can be used on a map to provide


further simplification of the Boolean expression.
Dont Care:
Dont cares can be treated as 0s and 1s which ever is more convenient
in the process of k-map simplification.

Example:

166
Simplify the Boolean function
F (w, x, y, z) = (1, 3, 7, 11, 15)
which has the dont-care conditions
d (w, x, y, z) = (0, 2, 5)
Determining the minimum POS expression from the Map:

Example of mapping a standard POS expression:


(A+B+C+D)(A+B+C+D)(A+B+C+D)(A+B+C+D)(A+B+C+D)

Complement Input(10 )

169
Example to minimize POS expression
(B+C+D)(A+B+C+D)(A+B+C+D)(A+B+C+D)(A+B+C+D)

The minimum POS is (C+D)(A+B+D)(A+B+C)

170
Dont Care:
In many applications there are unspecified minterms and
they are the dont care Conditions.

Dont cares are used on the map for further simplification of


Boolean expression.

Dont care minterm is a combination of variables whose logical value is not


Specified.

Dont cares can be treated as 0s and 1s which ever is more convenient


in the process of k-map simplification.
Dont Care:
Dont Care:

Two Possible ways of reduction


5-Variable K-Map:
Two method of mapping: Gray code and overlay

This is the older version of the five variable K-map, a Gray


Code map or reflection map
5-Variable K-Map:

The overlay version of the Karnaugh map, shown above, is


simply two (four for a 6-variable map) identical maps except for
the most significant bit of the 3-bit address across the top.
5-Variable K-
Map:
Numbering the 5-variable K-Map as below.
Example 1 of 5-Variable K-Map

F = (1, 3, 4, 5, 11, 12, 14, 16, 20, 21, 30)


Example 1 of 5-Variable K-Map Cntd

(4, 5, 20, 21) BCD (Since A & E are the changing variables, it is
eliminated)
(12, 14) ABCE (Since D is the changing variable, it is
eliminated)
(14, 30) BCDE (Since A is the changing variable, it is
eliminated)
(3, 11) AC'DE (Since B is the changing variable, it is
eliminated)
(16, 20) ABD'E (Since C is the changing variable, it is
eliminated)
(1, 3) AB'CE (Since D is the changing variable, it is
eliminated)

Thus, F = BCD + ABCE + BCDE + AC'DE + ABD'E + AB'CE


Example 2 of 5-Variable K-Map

F = (0, 2, 3, 5, 7, 8, 11, 13, 17, 19, 23, 24, 29, 30)

D= (12,14,15)

Reduce the expression without and with dont care


Example 2 of 5-Variable K-Map Cntd

Without dont care

F = BDE + AC'DE + AB'CE + AB'CE + ABC'E + BCDE + BCD'E +


ABCDE
Example 2 of 5-Variable K-Map Cntd

With dont care

F = ABC + ACE + ADE + BDE + BCDE +BCDE +BCDE + ABCD +


ABCE
6-Variable K-Map
A 6-variable K-Map will have 26 = 64 cells.
Example 1 of 6-Variable K-Map
F = (0, 2, 4, 8, 10, 13, 15, 16, 18, 20, 23, 24, 26, 32,
34, 40, 41, 42, 45, 47, 48, 50, 56, 57, 58, 60, 61)
Example 1 of 6-Variable K-Map Cntd

(1,2,8,10,16,18,24,26,32,34,40 ,42,48,50,56,58)-DF
(41, 45, 57, 61) ACEF (B & D are changing variables, so they are
eliminated)
(13, 15, 45, 47) BCDF (A & E are changing variables, so they are
eliminated)
(0, 4, 16, 20) AC'EF (B & D are changing variables, so they are
eliminated)
(56, 57, 60, 61) ABCE (D and F are changing variables, so they are
eliminated)
F = DF + ACEF + BCDF + AC'EF + ABCE + ABCDEF
There is 1 in cell 23, which can not be looped with any adjacent cell,
hence it can not be simplified further and left as it is.
23 = ABCDEF
Product of sum simplification
Simplify the following Boolean function in
a) SOP
b) POS

F(A, B, C, D)=(0,1,2,5,8,9,10)
Product of sum simplification Cntd

Simplified POS form


Example to minimize POS expression
(B+C+D)(A+B+C+D)(A+B+C+D)(A+B+C+D)(A+B+C+D)

F=CD+ABD+ABC
F=(C+D)(A+B+D)(A+B+C)

The minimum POS is (C+D)(A+B+D)(A+B+C)


Quine-McCluskey (Tabular)
Minimization
Two step process utilizing tabular listings to:
Identify prime implicants (implicant tables)
Identify minimal PI set (cover tables)

All work is done in tabular form


Number of variables is not a limitation
Basis for many computer implementations
Dont cares are easily handled

Proper organization and term identification are


key factors for correct results
Quine-McCluskey Minimization (cont.)
Terms are initially listed one per line in groups
Each group contains terms with the same number
of true and complemented variables
Terms are listed in numerical order within group

Terms and implicants are identified using one


of three common notations
fullvariable form
cellular form
1,0,- form
Notation Forms
Full variable form - variables and
complements in algebraic form
hard to identify when adjacency applies
very easy to make mistakes

Cellular form - terms are identified by


their decimal index value
Easy to tell when adjacency applies; indexes
must differ by power of two (one bit)
Implicants identified by term nos. separated
by comma; differing bit pos. in () following
terms
Notation Forms (cont.)
1,0,- form - terms are identified by their
binary index value
Easier to translate to/from full variable form
Easy to identify when adjacency applies, one
bit is different
- shows variable(s) dropped when adjacency
is used
Different forms may be mixed during the
minimization
Example of Different Notations
F(A, B, C, D) = m(4,5,6,8,10,13)
Full variable Cellular 1,0,-

1 ABCD 4 0100
ABCD 8 1000
2 ABCD 5 0101
ABCD 6 0110
ABCD 10 1010
3 ABCD 13 1101
Tabulation Method
Map method of simplification is convenient as long the no. of variables is six

As no. of variable increases, no. of cells will also increase and grouping
prevents a reasonable selection.

Tabulation method has to steps,


i) Find prime implicants
ii) Examine to see they are redundant(Essential prime implicants)
Steps to find prime implicant by matching process
This process compares each minterm with every other minterm.

If two minterms differ in only one variable, that variable is removed

This is repeated for every minterm.

The minterms are compared with those of the next section down onl

The unchecked terms in the previous table forms the prime implican

Sum of prime implicants gives minimized SOP.


Tabulation Method
Example1: Determine prime implicant for the following

F=(0,1,2,8,10,11,14,15)
Tabulation Method
Tabulation Method

The tedious process of comparison is reduced if we use decimal


Instead of binary.

This method uses subtraction of decimal numbers instead of


comparing and matching of binary.

The minterms are arranged as above except that the decimal equivalents
of the minterms are listed.
Tabulation Method

Consider example 1:
Tabulation Method
Process of comparing minterm is as follow.

If the decimal number in section below is greater than the number in


section above by a power of 2, check both the terms to show that they
have been used, and write them in next column.

The pair of numbers transferred to second column includes a third term in


parentheses. This number designates the power of 2 by which the number
differs.

The prime implicants are those terms not checked in the table. It is same
as before except that they are given in decimal.
Tabulation Method

Prime implicant minterm:

Convert all decimal numbers to binary and then insert a dash in those
positions
designated by the numbers in parentheses.

Thus
i) 0,1(1) is converted to binary as 0000 0001
A dash in the first bit(20=1) position., 000-
ii) 0,2,8,10(2,8) is converted to binary as 0000 0010 1000 1010
Dash inserted in position 2 and 8 to result in -0-0

Thus prime implicant minterms for ex.1 are


Example2: Determine prime implicant for the following

F=(1,4,6,7,8,9,10,11,15)
Tabulation Method

Consider example 2:
Tabulation Method
Selection of essential prime implicants to form further minimized function is
made from prime implicant table.

Prime Implicant that cover MINTERMS with single X Essential Prime Implicants

Optimally need to cover all prime implicants , If we select 7,15 6, 7


and 11,15 indirect cover for 7,15
6 ,7
7,15
11,15
14,15
If we select 7,15 6, 7 & 14,15 and 11,15
indirect cover for 7,15
If new member 8,14 (second level
covering is not possible) so need to
include 8,14
Tabulation Method
F=(1,2,5,6,7,9,10,11,14,15)
Implication Table (1,0,-)
Quine-McCluskey
Implication Table
Method
Tabular method to Column I
systematically find all prime
0000
implicants
(A,B,C,D) = m(4,5,6,8,9, 0100
10,13) + d(0,7,15) 1000
Part 1: Find all prime 0101
implicants 0110
Step 1: Fill Column 1 with 1001
active-set and DC-set 1010
minterm indices. Group by 0111
number of true variables (# 1101
of 1s).
NOTE: DCs are included in this step! 1111
Implication Table (cellular)
Quine-McCluskey
Implication Table
Method
Tabular method to Column I
systematically find all prime
0
implicants
(A,B,C,D) = m(4,5,6,8,9, 4
10,13) + d(0,7,15) 8
Part 1: Find all prime 5
implicants 6
Step 1: Fill Column 1 with 9
active-set and DC-set 10
minterm indices. Group by 7
number of true variables (# 13
of 1s).
NOTE: DCs are included in this step! 15
Minimization - First Pass (1,0,-)
Quine-McCluskey Method
Tabular method to systematically find all Implication Table
prime implicants
(A,B,C,D) = m(4,5,6,8,9,10,13) + Column I Column II
d(0,7,15) 0000 0-00
Part 1: Find all prime implicants -000
Step 2: Apply Adjacency - Compare 0100
1000 010-
elements of group with N 1's against 01-0
those with N+1 1's. One bit difference 0101 100-
implies adjacent. Eliminate variable and 0110 10-0
place in next column. 1001
1010 01-1
E.g., 0000 vs. 0100 yields 0-00 -101
0000 vs. 1000 yields -000 0111 011-
When used in a combination, mark with a 1101 1-01
check. If cannot be combined, mark with 1111 -111
a star. These are the prime implicants. 11-1
Repeat until nothing left.
Minimization - First Pass (cellular)
Quine-McCluskey Method
Tabular method to systematically find all Implication Table
prime implicants
(A,B,C,D) = m(4,5,6,8,9,10,13) + Column I Column II
d(0,7,15) 0 0,4(4)
Part 1: Find all prime implicants 0,8(8)
Step 2: Apply Adjacency - Compare 4
8 4,5(1)
elements of group with N 1's against 4,6(2)
those with N+1 1's. 2n difference implies 5 8,9(1)
adjacent. Next col is numbers with diff in 6 8,10(2)
parentheses. 9
10 5,7(2)
E.g., 0 vs. 4 yields 0,4(4) 5,13(8)
5 vs. 7 yields 5,7(2) 7 6,7(1)
When used in a combination, mark with a 13 9,13(4)
check. If cannot be combined, mark with 15 7,15(8)
a star. These are the prime implicants. 13,15(2)
Repeat until nothing left.
Minimization - Second Pass (1,0,-)
Quine-McCluskey Method Implication Table
Step 2 cont.: Apply Adjacency - Compare Column I Column II Column
elements of group with N 1's against III
those with N+1 1's. One bit difference 0000 0-00 *
-000 * 01-- *
implies adjacent. Eliminate variable and
0100
place in next column.
1000 010- -1-1 *
E.g., 0000 vs. 0100 yields 0-00 01-0
0000 vs. 1000 yields -000 0101 100- *
0110 10-0 *
When used in a combination, mark with a 1001
check. If cannot be combined, mark with 1010 01-1
a star. These are the prime implicants. -101
0111 011-
1101 1-01 *
Repeat until nothing left.
1111 -111
11-1
Minimization - Second Pass (cellular)
Quine-McCluskey Method
Step 2 cont.: Apply Adjacency - Compare Implication Table
elements of group with N 1's against Column
those with N+1 1's. 2n difference implies Column I Column II III
adjacent. Next col is numbers with
0 0,4(4) * 4,5,6,7(3
differences in parentheses. 0,8(8) * ) *
E.g., 4,5(1) and 6,7(1) yields 4
4,5,6,7(3) 8 4,5(1) 5,7,13,15
4,6(2) (10) *
When used in a combination, mark with a 5 8,9(1) *
check. If cannot be combined, mark with 6 8,10(2) *
a star. These are the prime implicants. 9
Repeat until nothing left. 10 5,7(2)
5,13(8)
7 6,7(1)
13 9,13(4) *

15 7,15(8)
13,15(2)
Prime Implicants
Prime Implicants:
A
AB
CD 00 01 11 10

00 X 1 0 1
0 - 00 A C D - 000 B C D
01 0 1 1 1 100 - A B C 10 - 0 A B D
D

C
11 0 X X 0 1- 01 A C D -1 -1 B D
10 0 1 0 1
01 - - A B
B
Prime Implicants (cont.)
Prime Implicants:
A
AB
CD 00 01 11 10

00 X 1 0 1
0 - 00 A C D - 000 B C D
01 0 1 1 1 100 - A B C 10 - 0 A B D
D

C
11 0 X X 0 1- 01 A C D -1 -1 B D
10 0 1 0 1
01 - - A B
B

Stage 2: find smallest set of prime implicants that cover


the active-set

recall that essential prime implicants must be in


final expression
Coverage
Coverage Chart
Table
4 5 6 8 9 10 13
0,4(0-00) X

0,8(-000) X

8,9(100-) X X Note: Dont include DCs in


8,10(10-0) X X
coverage table; they dont
have covered by the final
9,13(1-01) X X
logic expression!
4,5,6,7(01--) X X X

5,7,13,15(-1-1) X X

rows = prime implicants


columns = ON-set elements
place an "X" if ON-set element is
covered by the prime implicant
Coverage Table (cont.)
Coverage Chart

4 5 6 8 9 10 13 4 5 6 8 9 10 13
0,4(0-00) X 0,4(0-00) X

0,8(-000) X 0,8(-000) X

8,9(100-) X X 8,9(100-) X X

8,10(10-0) X X 8,10(10-0) X X

9,13(1-01) X X 9,13(1-01) X X

4,5,6,7(01--) X X X 4,5,6,7(01--) X X X

5,7,13,15(-1-1) X X 5,7,13,15(-1-1) X X

rows = prime implicants If column has a single X, than the


columns = ON-set elements implicant associated with the row
place an "X" if ON-set element is is essential. It must appear in
covered by the prime implicant minimum cover
Coverage Table (cont.)
4 5 6 8 9 10 13
0,4(0-00) X

0,8(-000) X

8,9(100-) X X

8,10(10-0) X X

9,13(1-01) X X

4,5,6,7(01--) X X X
X
5,7,13,15(-1-1) X

Eliminate all columns covered by


essential primes
Coverage Table (cont.)
4 5 6 8 9 10 13 4 5 6 8 9 10 13
0,4(0-00) X 0,4(0-00) X

0,8(\000) X 0,8(\000) X

8,9(100-) X X 8,9(100-) X X

8,10(10-0) X X 8,10(10-0) X X

9,13(1-01) X X 9,13(1-01) X X

4,5,6,7(01--) X X X 4,5,6,7(01--) X X X
X X
5,7,13,15(-1-1) X 5,7,13,15(-1-1) X

Eliminate all columns covered by Find minimum set of rows that


essential primes cover the remaining columns

F ABD ACD AB

You might also like