Вы находитесь на странице: 1из 25

ECE 2300

Digital Logic & Computer Organization


Spring 2018

Combinational Logic Minimization

Lecture 3: 1
Announcements
• Lab 2 is on CMS
– Tutorial B: CAD tool installation

• HW 1 will be released tonight

• Rescheduled lecture: Monday Feb 5 @ 7:15pm,


PHL 101
– Video replay on Thursday Feb 8 during the regular
lecture time at Thurston 203

Lecture 3: 2
Boolean Function Representations
• Y = 1 if and only if A•B ≠ (B’+C) ABC Y
000 1
• Step 1: Lay out the truth table 001 1
010 0
• Step 2: Derive canonical forms 011 1
– Canonical sum 100 1
Y = A’•B’•C’ + A’•B’•C + A’•B•C + A•B’•C’ 101 1
+ A•B’•C + A•B•C’ = ∑A,B,C (0,1,3,4,5,6) 110 1
– Canonical product
111 0
Y = (A+B’+C)(A’+B’+C’) = ∏A,B,C (2,7)

• Step 3: Simplification (this lecture)


Lecture 3: 3
Combinational Logic
• Outputs depend only on current inputs
– Example: Detect if the input is an odd number
– Can be represented in two-level or multi-level forms

• In contrast, sequential logic has “memory” or


“state”
– Example: Detect if the last two inputs are odd
– We’ll cover sequential logic later

Lecture 3: 4
Two-Level Logic: Sum-of-Products
• Sum of product terms (SOP)
– e.g., A’•B’ + A’•C’ + A•B•C

• Circuits look something like this


– A bubble indicates the signal is inverted
wire

inputs output

AND-OR

Lecture 3: 5
Two-Level Logic: Product-of-Sums
• Product of sum terms (POS)
– e.g., (A’+C’) • (B’+C’) • (A+B+C)

• Circuits look something like this

OR-AND
Combinational logic can be expressed as SOP or POS
Lecture 3: 6
Algebraic Simplification
• Apply theorems to canonical sum (product) to
reduce (1) the number of terms, and (2) the
number of literals in each term

• Results in a more compact expression and


lower cost digital logic implementation

• We focus on minimizing two-level logic in this


lecture

Lecture 3: 7
Algebraic Simplification Example
A
• Binary adder B
S
Cout
– inputs: A, B, Carry-in (Cin) Cin
– outputs: Sum, Carry-out (Cout)

• Truth Table à Canonical sum


A B Cin Cout
S Cout
S
0 0 0 00 0
0 0 1 10 01 S = A'•B'•Cin + A'•B•Cin' + A•B'•Cin' + A•B•Cin
0 1 0 10 01 Cout = A'•B•Cin + A•B'•Cin + A•B•Cin' + A•B•Cin
0 1 1 01 10
1 0 0 10 01
1 0 1 01 10
1 1 0 01 10
1 1 1 11 1 Lecture 3: 8
Algebraic Simplification Example
Cout = A'•B•Cin + A•B'•Cin + A•B•Cin' + A•B•Cin
= A'•B•Cin + A•B'•Cin + A•B•Cin' + A•B•Cin + A•B•Cin (idempotency)
= B•Cin + A•B'•Cin + A•B•Cin' + A•B•Cin (combining)
= B•Cin + A•B'•Cin + A•B•Cin' + A•B•Cin + A•B•Cin (idempotency)
= B•Cin + A•Cin + A•B•Cin' + A•B•Cin (combining)
= B•Cin + A•Cin + A•B (combining)

We can apply these theorems in a more


intuitive fashion using a Karnaugh Map

Lecture 3: 9
Reduction in Hardware Cost

Cout = A'•B•Cin + A•B'•Cin + A•B•Cin' + A•B•Cin

= B•Cin + A•Cin + A•B

3 inverters
3 two-input ANDs
4 three-input ANDs à 1 three-input OR
1 four-input OR

Lecture 3: 10
Karnaugh Map (K-Map)
• Idea: Use combining and idempotency theorems
visually to simplify canonical forms (into two-
level SOP or POS)

• Multidimensional representation of a truth table

• Adjacent cells represent minterms (or maxterms)


that differ by exactly one literal
– Cyclic encoding along each dimension

• At most two variables per dimension


Lecture 3: 11
K-Map for Cout
A B Cin S
S Cout AB
0 0 0 00 0 Cin 00 01 11 10
0 0 1 11 0
0 1 0 11 0 0 0 0 1 0
0 1 1 00 1
1 0 0 11 0
1 0 1 00 1
1 0 1 1 1
1 1 0 00 1
1 1 1 11 1

Lecture 3: 12
Some K-Map Definitions
• 1-cell: Minterm of a canonical sum

• Implicant: Set of adjacent 1-cells


– A rectangle in K-Map
– Number of cells contained must be a power of 2

• Prime Implicant: Implicant that cannot be


contained in a larger implicant
AB
Cin 00 01 11 10
A prime
0 0 0 1 0 implicant

1 0 1 1 1
Lecture 3: 13
Minimization Using K-Map
• Goal: Cover all 1-cells with the minimum number
of prime implicants

• Procedure
– Plot 1’s corresponding to minterms of function
– Circle largest possible rectangular sets of 1’s
• Must be power of 2
• Including “wrap-around” sets
– Repeat until all minterms are covered
– OR product terms derived from each circle

• Minimizes number of gates and gate inputs


Lecture 3: 14
Simplifying Cout Using a K-Map
Cout = A'•B•Cin + A•B'•Cin + A•B•Cin' + A•B•Cin
= A'•B•Cin + A•B'•Cin + A•B•Cin' + A•B•Cin + A•B•Cin (idempotency)
= B•Cin + A•B'•Cin + A•B•Cin' + A•B•Cin (combining)
= B•Cin + A•B'•Cin + A•B•Cin' + A•B•Cin + A•B•Cin (idempotency)
= B•Cin + A•Cin + A•B•Cin' + A•B•Cin (combining)
= B•Cin + A•Cin + A•B (combining)

AB
Cin 00 01 11 10
Ovals result from
0 0 0 1 0 applying combining
theorem

1 0 1 1 1 Idempotency theorem
allows ovals to overlap

Lecture 3: 15
3 Variable K-Map Example
F=ΣA,B,C(4,5,6,7)

AB
C 00 01 11 10

0 1 1
F=A
1 1 1

Lecture 3: 16
Another Example
F=ΣA,B,C(0,1,2,4,5,7)
AB
C 00 01 11 10

0 1 1 1
A’•C’
1 1 1 1

B’ A•C

F = A’•C’ + B’ + A•C
Lecture 3: 17
4 Variable K-Map
AB
CD 00 01 11 10

00

01

11

10

Lecture 3: 18
Combining Theorem in Action
AB
CD 00 01 11 10

00

01 1 1

11 1 1

10

A’BC’D + A’BCD + ABC’D + ABCD


A’BD + ABD
BD Lecture 3: 19
Combining Theorem in Action
AB
CD 00 01 11 10

00 1 1

01

11

10 1 1

A’B’C’D’ + A’B’CD’ + AB’C’D’ + AB’CD’


A’B’D’ + AB’D’
B’D’ Lecture 3: 20
4 Variable Karnaugh Map Example
F=ΣA,B,C,D(5,7,12,13,14,15)
AB
CD 00 01 11 10

00 1

01 1 1

11 1 1

10 1

F = B•D + A•B
Lecture 3: 21
Another Example
• Detect all even digits from 0 to 15 except 6
– F=ΣA,B,C,D(0,2,4,8,10,12,14)
AB
CD 00 01 11 10

00 1 1 1 1

01

11

10 1 1 1

F = B’D’ + AD’ + C’D’


Lecture 3: 22
Minimizing Product-of-Sums
• Procedure
– Plot 0’s corresponding to maxterms of function
– Circle largest possible rectangular sets of 0’s
• Must be power of 2
• Including “wrap-around” sets
– Repeat until all maxterms are covered
– AND sum terms derived from each circle

Lecture 3: 23
Product-of-Sums Example
F=πA,B,C,D(0, 2, 6, 7, 8, 10)

AB
CD 00 01 11 10
Corners:
00 0 0 B+D
01 Other:
11 0 A+B’+C’

10 0 0 0
F=(B+D)•(A+B’+C’)

Lecture 3: 24
Before Next Class
• H&H 1.7, 2.8

Next Time

CMOS Logic

Lecture 3: 25

Вам также может понравиться