0% found this document useful (0 votes)
50 views10 pages

Lecture 6-Combinatorial Networks-Karnaugh Mapping

The document discusses logic gates, combinational circuits, and Karnaugh mapping. It provides examples of using truth tables to design combinational circuits using logic gates in sum-of-products form. It also demonstrates how to use Karnaugh mapping to minimize logic expressions by grouping ones and eliminating inputs.

Uploaded by

Grant Georgia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views10 pages

Lecture 6-Combinatorial Networks-Karnaugh Mapping

The document discusses logic gates, combinational circuits, and Karnaugh mapping. It provides examples of using truth tables to design combinational circuits using logic gates in sum-of-products form. It also demonstrates how to use Karnaugh mapping to minimize logic expressions by grouping ones and eliminating inputs.

Uploaded by

Grant Georgia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

LOGIC GATES & COMBINATORIAL CIRCUITS

Consider a vending machine:

1. You wish to make a


selection and note the
cost
2. You don’t have the
exact change
3. You put in the coins
(dollar) and press the
appropriate snack
selection

4. How does the machine determine whether or not to


dispense the snack?

1
MECHATRONICS LAB
ME 140L

COMBINATORIAL CIRCUITS
AND KARNAUGH MAPPING

I. BOOLEAN ALGEBRA AND LOGIC DEVICES

A. BOOLEAN ALGEBRA

Mathematical structure consisting of a set containing 0 and 1: complement,


addition and multiplication.
Complement AND OR Exclusive OR
A A A B AB A B A+B A B A⊕ B
0 1 0 0 0 0 0 0 0 0 0
1 0 0 1 0 0 1 1 0 1 1
1 0 0 1 0 1 1 0 1
1 1 1 1 1 1 1 1 0
Multiplication (Product) Addition (Sum)

Note: Product is 1 iff all terms are1 and Sum is 0 iff all terms are 0.
Product is 0 iff one term is 0

Boolean Equivalences (needed to reduce the complexity of expressions)


A=A AA = A A+A=A
A•0 = 0 A+0=A A •1 = A
A +1 =1 A•A =0 A + A =1
AB = BA (comm ) A + B = B + A (comm) (AB)C = A(BC) (assoc)
A + (B + C) = (A + B) + C A(B + C) = AB + AC (B + C)A = BA + CA
(A + B) = A B AB = A + B De Morgan' s Laws
AB + AB = A A + AB = A (A + B)B = AB
(A + B)(A + B) = A (A + B)(A + C) = A + BC A(A + B) = A
AB + B = A + B

2
LOGIC DEVICES (3-input shown)
AND OR XOR NOT

NAND NOR XNOR

3
II. COMBINATORIAL NETWORKS
Combinations of binary inputs to generate a desired binary output

Example: Two-to-Four Decoder (2 2 = 4)

Two inputs: A B (each 0 or 1) x1


A
2 to 4 x2
Four possible outputs: Decoder x3
x1, x2, x3, x4 B x4

For each combination of A and B, only one xi goes high: called Truth Table
A B Output
0 0 x1
0 1 x2
1 0 x3
1 1 x4
Use ANDs and Inverters only to implement a combinatorial circuit that
will mimic the 2-to-4 decoder

x3

x4 x1

x2

Use NANDs and Inverters only

x3

x4 x1

x2

4
A. Combinatorial Networks: Sum of Products
Example: Given a Truth Table, Design a Combinatorial Circuit using Logic Gates

INPUTS
A B C OUTPUT X Note: 3 inputs (0 or 1)
0 0 0 0 will have 23=8 combinations
0 0 1 1
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 0
1 1 1 0

Approach 1
Sum-of-Products: For each 1 in the output column, find the product
involving all the inputs and sum all the products together.
X = A B C + ABC + ABC (called minterms) → note sum of products

Now apply Boolean Algebra to reduce the expression to ' minimal' form :
X = A(BC + BC) + ABC = AC(B + B) + ABC = AC + ABC = (A + AB)C

But we can reduce the expression even further :


X = C(A + AB)
Note the last equivalence : αβ + β = α + β and look at the expr in paren.
in our case : A + AB = BA + A = B + A = AB ( DeMorgan' s )
where we used α = B and β = A
→ X = CAB Note how we have reduced the expression to a simple form

Approach 2
Product-of-Sums: For each 0 in the output column, find the sum
involving all the inputs and multiply all the sums together. If column entry
is 0, use its corresponding variable directly, if entry is 1, use the
complement of variable. Then use Boolean algebra to reduce expression.
X = (A + B + C)(A + B + C)(A + B + C)(A + B + C)(A + B + C )

Will not used in lab—(see Appendix).

5
III. KARNAUGH MAPPING
Minimizes sum-of-products expressions in a systematic way

From the previous example, entries of truth table are put in a Karnaugh map:

AB AB
00 01 11 10 00 01 10 11
C 0 0 0 0 0 C 0 0 0 0 0
1 1 1 0 1 1 1 1 1 0

BEWARE: Note the AB row on left map—only one variable is changed


at a time as you go right (wrap around). Map at right is not correct.

Strategy: Try to group 1’s—Largest vectors/matrices: make 2x1 (1x2); 4x1


(4x1) vectors, 2x2 matrix, 2x4 matrix, 4x4 matrix, etc—will make some
inputs irrelevant.

From before: X = A B C + ABC + ABC


Combine C=1 and AB=00,01 → C=1, A=0 and B can be anything (0 or 1) → AC
This is the step A B C + ABC = A(BC + BC) = AC( B + B) = AC
Combine C=1 and AB=00,10 → C=1, B=0 and A can be anything (0 or 1) → BC

Note: as you group the 1’s, you reduced the number of inputs in the expression,
thereby reducing the expressions and reducing the number of logic gates needed.

X = A B C + ABC + ABC reduced to X = A C + BC and finally using one Boolean


expression
Sum of Products : X = AC + BC = C(A + B) = CAB (using DeMorgan' s Law)

A
B

B
X A
X
C C

Notice the reduction in number of components in just the last expression.


Imagine the number of components needed to implement the original
expression.

6
Examples:

AB
00 01 11 10
C 0 0 1 1 1
1 0 1 0 0

SOP : X = AB + AC

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

SOP : X = A B + C D + BD

AB
00 01 11 10
CD 00 Y 1 0 1
01 1 Y 0 Y
11 1 0 0 1
10 Y 0 Y 1

Note: Y denotes ‘don’t cares’—don’t care if 1 or 0 so use them to


your advantage to make larger groupings

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

SOP : X = AB + BD + AB C SOP : X = B + A C

7
AB
00 01 11 10
CD 00 1 1 0 1
01 1 1 0 1
11 1 0 0 1
10 0 0 0 1

SOP : X = AB + A C + BD

8
Example: To provide water for his cattle, a farmer purchased a circular, four-
outlet water dispenser shown below. In order to couple the dispensing of
water with the dispensing of food, the farmer decides to add a digital circuit.

The water dispenser will turn ‘on’ a feeding device: 1) when any two
adjacent water outlets are used simultaneously but will turn the feeder device
‘off’ if 2) all four water outlets are used simultaneously.

Assume the water outlets are A


labeled A, B, C, and D and the
signal to the feed device is called F.

Determine the equation of the


minimum SOP digital logic circuit D B
necessary to perform this task, and
show the digital logic circuit. C

Truth Table AB
A B C D F 00 01 11 10
0 0 0 0 0 00 0 0 1 0
0 0 0 1 0 CD 01 0 0 1 1
0 0 1 0 0 11 1 1 0 1
0 0 1 1 1 10 0 1 1 0
0 1 0 0 0
0 1 0 1 0 F = ACD + BCD + ABC + ABD
0 1 1 0 1
0 1 1 1 1 A

1 0 0 0 0 B
1 0 0 1 1
1 0 1 0 0 C

F
1 0 1 1 1
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1 D

1 1 1 1 0
1 1 1 0 1
1 1 1 1 0

9
APPENDIX: PRODUCT OF SUMS (FYI only for ME140L)

INPUTS
A B C OUTPUT X
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 0
1 1 1 0

Sum is 0 iff all of its terms are 0. Product is 0 iff one of the factors is zero.

Form a sum for each row in which the output is zero and multiply the sums together.
If a column entry is 0, its corresponding variable is used directly, otherwise its
complement is used.

X = (A + B + C)(A + B + C)(A + B + C)(A + B + C)(A + B + C )


Reduction is not very easy.

Alternatively : Solve for the 0s as you would for the 1' s in sum of products.
Complement the resulting expression
X = A B C + A B C + A B C + AB C + ABC
X = A (B + B) C + AB C + A B(C + C ) = AC + AB C + AB = (A + AB) C + AB and
using the (*) result : X = ABC + AB → Let Z = AB, then C Z + Z = C + Z = C + AB
X = C + AB = CAB Same as above

10

You might also like