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

UNIVERSITY OF THE WITWATERSRAND, JOHANNESBURG

ELEN2021 : Microprocessors
Digital Logic and Design

Chabalala Chabalala
2021
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

Combinational Logic Design

Sections: 2.3, 2.4, 2.5 and 2.7

Page 2
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

In the previous lecture …

• Rules of combinational logic.

• Boolean equations.

• Boolean algebra.

Page 3
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

Summary of points from the previous lecture…

• Rules of combinational logic, whereby the output depends


only on the current values of inputs.

• Described how to derive Boolean equations for logic


functions from any truth table.

• Any Boolean function can be described by a truth table, or


equivalently, in terms of AND/OR/NOT operations.

• The Axioms and theorems of Boolean Algebra, which can


be applied to simplify digital circuits.

Page 4
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

In this lecture …

• Boolean Algebra of Several Variables.

• De Morgan’s Theorem.

• Karnaugh Maps (K-Maps).

Page 5
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

Boolean Theorems of Several Variables

Number Theorem Name


T6 B•C = C•B Commutativity
T7 (B•C) • D = B • (C • D) Associativity
T8 B • (C + D) = (B•C) + (B•D) Distributivity
T9 B• (B+C) = B Covering
T10 (B•C) + (B•C) = B Combining
T11 (B•C) + (B•D) + (C•D) = Consensus
(B•C) + (B•D)

Page 6
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

Boolean Theorems of Several Variables

Number Theorem Name


T6 B•C = C•B Commutativity
T7 (B•C) • D = B • (C • D) Associativity
T8 B • (C + D) = (B•C) + (B•D) Distributivity
T9 B• (B+C) = B Covering
T10 (B•C) + (B•C) = B Combining
T11 (B•C) + (B•D) + (C•D) = Consensus
(B•C) + (B•D)
How do we prove these are true?
Page 7
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

How to Prove
• Method 1 → Prove by Induction:
- This is also called: proof by exhaustion, check every
possible input value.
- If two expressions produce the same value for every
possible input combination, the expressions are equal.

• Method 2 → Theorems and Axioms:


- Use other theorems and axioms to simplify equations.
- Make one side of the equation look like the other.

Page 8
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

Example: Method 1 - Proof by Induction

Number Theorem Name


T9 B• (B+C) = B Covering

B C (B+C) B(B+C)
0 0
0 1
1 0
1 1

Page 9
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

Example: Method 1 - Proof by Induction

Number Theorem Name


T9 B• (B+C) = B Covering

B C (B+C) B(B+C)
0 0 0 0
0 1 1 0
1 0 1 1
1 1 1 1

Page 10
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

Example: Method 1 - Proof by Induction

Number Theorem Name


T9 B• (B+C) = B Covering

B C (B+C) B(B+C)
0 0 0 0
0 1 1 0
1 0 1 1
1 1 1 1

Page 11
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

Example: Method 2 - Theorems and Axioms

Number Theorem Name


T9 B• (B+C) = B Covering

• Prove true using other axioms and theorems:


B•(B+C) = B•B + B•C T8: Distributivity
= B + B•C T3: Idempotency
= B•(1 + C) T8: Distributivity
= B•(1) T2: Null element
=B T1: Identity
Page 12
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

Example: Method 2 - Theorems and Axioms

Number Theorem Name


T10 (B•C) + (B•C) = B Combining

Prove true using other axioms and theorems:


B•C + B•C = B•(C+C) T8: Distributivity
= B•(1) T5’: Complements
=B T1: Identity

Page 13
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

Boolean Theorem of Several Variables: Dual

# Theorem Dual Name


T6 B•C = C•B B+C = C+B Commutativity
T7 (B•C) • D = B • (C•D) (B + C) + D = B + (C + D) Associativity
T8 B • (C + D) = (B•C) + (B•D) B + (C•D) = (B+C) (B+D) Distributivity
T9 B • (B+C) = B B + (B•C) = B Covering
T10 (B•C) + (B•C) = B (B+C) • (B+C) = B Combining
T11 (B•C) + (B•D) + (C•D) = (B+C) • (B+D) • (C+D) = Consensus
(B•C) + (B•D) (B+C) • (B+D)

Dual: Replace: • with +


0 with 1
Page 14
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

Simplifying Boolean Equations

• Axioms and theorems are useful for simplifying


Boolean functions/equations.
• Reducing an equation to the fewest number of
implicants, where each implicant has the fewest
literals. Recall:
– Literal: variable or its complement: A, A, B, B, C, C
– Implicant: product of literals: ABC, AC, BC
• This is also called minimizing the equation.
– Example: Y = PA + PA → P
Page 15
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

Simplifying Boolean Equations

• Example 1
Y= AB + AB
= A(B + B) T8: Distributivity
= A(1) T5’: Complements
= A T1: Identity

• Example 2
Y= A(AB + ABC)
= A(AB(1 + C)) T8: Distributivity
= A(AB(1)) T2’: Null Element
= A(AB) T1: Identity
= (AA)B T7: Associativity
= AB T3: Idempotency

Page 16
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

Review: SOP and POS Form


• SOP – sum-of-products
O C E minterm
0 0 0 O C
0 1 0 O C E = OC
1 0 1 O C = Σ(2)
1 1 0 O C

• POS – product-of-sums
O C E maxterm
0 0 0 O + C E = (O + C)(O + C)(O + C)
0 1 0 O + C
1 0 1 O + C = Π(0, 1, 3)
1 1 0 O + C
Page 17
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

SOP Form: Multiplying Out


• An expression is in sum-of-products (SOP) form
when all products contain literals only.
- SOP form: Y = AB + BC + DE
- NOT SOP form: Y = DF + E(A+B)
- SOP form: Z = A + BC + D E F

• Example: Y = (A + C + D + E)(A + B)
Y = AA+AB+AC+BC+AD+BD+AE+BE T8: Distributivity
= A+AB+AC+AD+AE+BC+BD+BE T3: Idempotency
= A + BC + BD + BE T9’: Covering

Page 18
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

POS Form: Factoring Out


• An expression is in product-of-sums (POS) form
when all sums contain literals only.
- POS form: Y = (A+B)(C+D)(E+F)
- NOT POS form: Y = (D+E)(F+GH)
- POS form: Z = A(B+C)(D+E)

• Example: Y = (A + BCDE)
Apply T8’ first when possible: W+XZ = (W+X)(W+Z)
Make: X = BC, Z = DE and rewrite equation
Y = (A+XZ) substitution (X= BC, Z=DE)
= (A+ BC)(A+DE) T8’: Distributivity
= (A+ B)(A+C)(A+D)(A+E) T8’: Distributivity
Page 19
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

De Morgan’s Theorem

Number Theorem Name


T12 B0 • B1 • B2 … = B0+B1+B2… DeMorgan’s
Theorem

The complement of the product


is the
sum of the complements

Page 20
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

De Morgan’s Theorem: Dual

# Theorem Dual Name


T12 B0 • B1 • B2… = B0 + B1 + B2… DeMorgan’s
B0+B1+B2… = B0•B1•B2… Theorem

The complement of the product


is the
sum of the complements.

Dual: The complement of the sum


is the
product of the complements.
Page 21
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

DeMorgan’s Theorem

• Y = AB = A + B → A
B
Y

A
Y
B

• Y=A+B=A B → A
B
Y

A
Y
B

Page 22
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

DeMorgan’s Theorem - Example

Y = (ACE+D) + B
= (ACE+D) • B
= (ACE•D) • B
= ((AC+E)•D) • B
= ((AC+E)•D) • B
= (ACD + DE) • B
= ABCD + BDE

Page 23
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

DeMorgan’s Theorem – Bubble Pushing


• Backward:
– Body changes
– Adds bubbles to inputs

A A
Y Y
B B

• Forward:
– Body changes
– Adds bubble to output

A A
Y Y
B B
Page 24
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

DeMorgan’s Theorem – Bubble Pushing Rules

• Begin at output, then work toward inputs.


• Push bubbles on final output back.
• Draw gates in a form so bubbles cancel.

A
B

C Y
D

Page 25
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

DeMorgan’s Theorem – Bubble Pushing Example

• What is the Boolean expression for this circuit?

A
B

C Y
D

Page 26
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

DeMorgan’s Theorem – Bubble Pushing Example


no output
A bubble
B

C Y
D

Page 27
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

DeMorgan’s Theorem – Bubble Pushing Example


no output
A bubble
B

C Y
D

bubble on
A input and output
B

C Y
D

Page 28
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

DeMorgan’s Theorem – Bubble Pushing Example


no output
A bubble
B

C Y
D

bubble on
A input and output
B

C Y
D
no bubble on
input and output
A
B

C Y
D
Y = ABC + D
Page 29
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

From Logic to Gates: Sum-of-Products Schematic

• Two-level logic: ANDs followed by ORs


• Example: Y = ABC + ABC + ABC
A B C

A B C
minterm: ABC

minterm: ABC

minterm: ABC

Page 30
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

Circuit Schematic Rules

• Inputs on the left (or top),

• Outputs on right (or bottom),

• Gates flow from left to right,

• Straight wires are best.

Page 31
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

Circuit Schematic Rules…


• Wires always connect at a T junction,
• A dot where wires cross indicates a connection
between the wires.
• Wires crossing without a dot make no connection.
wires crossing
wires connect wires connect without a dot do
at a T junction at a dot not connect

Page 32
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

Karnaugh Maps (K-Maps)

• Boolean expressions can be minimized by combining


terms, K-maps make the combination easy.
• K-maps minimize equations graphically.
• For example, eliminate A → Y = PA + PA = P

A B C Y Y Y
AB AB
0 0 0 1
00 01 11 10 C 00 01 11 10
0 0 1 1 C
0 1 0 0
0 1 1 0 0 1 0 0 0 0 ABC ABC ABC ABC
1 0 0 0
1 0 1 0
1 1 0 0 1 1 0 0 0 1 ABC ABC ABC ABC
1 1 1 0

Page 33
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

K-Map
• Circle 1’s in adjacent squares
• In Boolean expression, include only literals
whose true and complement form are not in the
circle
Y
A B C Y AB
0 0 0 1 00 01 11 10
0 0 1 1 C
0 1 0 0
0 1 1 0 0 1 0 0 0
1 0 0 0
1 0 1 0
1 1 0 0 1 1 0 0 0
1 1 1 0

Y = 𝑨𝑩
Page 34
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

Exercise: 3 Input K-Map


Y
AB
C 00 01 11 10

0 ABC ABC ABC ABC

1 ABC ABC ABC ABC

Truth Table K-Map


Y
A B C Y AB
0 0 0 0 C 00 01 11 10
0 0 1 0
0 1 0 1 0
0 1 1 1
1 0 0 0
1 0 1 0 1
1 1 0 0
1 1 1 1
Page 35
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

K-Map Definitions

• Complement: variable with a bar over it


A, B, C,
• Literal: variable or its complement
A, A, B, B, C, C
• Implicant: product of literals
ABC, AC, BC
• Prime implicant: implicant corresponding to the
largest circle in a K-map

Page 36
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

K-Map Rules

• Every 1 must be circled at least once,

• Each circle must span a power of 2 (i.e. 1, 2, 4)


squares in each direction,

• Each circle must be as large as possible,

• A circle may wrap around the edges,

• A “don't care” (X) is circled only if it helps minimize


the equation.
Page 37
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

4-Input K-Map

A B C D Y Y
0 0 0 0 1 AB
0 0 0 1 0 CD 00 01 11 10
0 0 1 0 1
0 0 1 1 1 00
0 1 0 0 0
0 1 0 1 1
0 1 1 0 1 01
0 1 1 1 1
1 0 0 0 1
1 0 0 1 1 11
1 0 1 0 1
1 0 1 1 0
1 1 0 0 0 10
1 1 0 1 0
1 1 1 0 0
1 1 1 1 0

Page 38
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

4-Input K-Map

A B C D Y Y
0 0 0 0 1 AB
0 0 0 1 0 CD 00 01 11 10
0 0 1 0 1
0 0 1 1 1 00 1 0 0 1
0 1 0 0 0
0 1 0 1 1
0 1 1 0 1 01 0 1 0 1
0 1 1 1 1
1 0 0 0 1
1 0 0 1 1 11 1 1 0 0
1 0 1 0 1
1 0 1 1 0
1 1 0 0 0 10 1 1 0 1
1 1 0 1 0
1 1 1 0 0
1 1 1 1 0

Page 39
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

4-Input K-Map

A B C D Y Y
0 0 0 0 1 AB
0 0 0 1 0 CD 00 01 11 10
0 0 1 0 1
0 0 1 1 1 00 1 0 0 1
0 1 0 0 0
0 1 0 1 1
0 1 1 0 1 01 0 1 0 1
0 1 1 1 1
1 0 0 0 1
1 0 0 1 1 11 1 1 0 0
1 0 1 0 1
1 0 1 1 0
1 1 0 0 0 10 1 1 0 1
1 1 0 1 0
1 1 1 0 0
1 1 1 1 0 Y = AC + ABD + ABC + BD

Page 40
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

Summary
• Boolean equations can be simplified using the rules of
Boolean algebra or K-maps.

• K-maps are a graphical tool for simplifying Boolean


equations, usually used with up to four variables.

• Logic simplification helps towards finding low-cost method


of implementing logic functions.

• With practice, designers can simplify functions with few


variables by inspection, and use computer–aided design
tools for more complicated logic functions.
Page 41
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

Next Lecture: Thursday 22 April 2021 @ 12h30

• K-maps with Don’t care States.

• Selected combinational logic circuits.

Page 42
ELEN2021 : Microprocessors
Digital Logic and Design
Combinational Logic Design

Thank you!

Page 43

You might also like