combinational logic design with optimization chapter 2 and 6

46
Section 2 Combinational Logic Design with Optimization Chapter 2 and 6.2

Upload: others

Post on 20-Jan-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

Section 2

Combinational Logic Design with OptimizationChapter 2 and 6.2

Basic gates

● NOT Gate (Inverter)

Basic Gates

● OR Gate

Basic Gates

● AND Gate

A Simple Circuit

● Design a garage close circuit that activates the garage door motor when the door is open, the object sensor is off, and Close button is pressed.

Boolean Algebra

Symbol Name Description Priority

( ) Parenthesis Evaluate expression inside parenthesis first

Highest

' NOT Evaluate left to right

* AND Evaluate left to right

+ OR Evaluate left to right Lowest

Boolean Algebra (Terms)

● Variable – A term that represents a value● Literal – The usage of a variable in a

formula● Sum-Of-Products (SOP)

F = XYZ + X'Y'Z + XY'Z'● Product-Of-Sums (POS)

G = (X + Y + Z)(X' + Y' + Z)(X + Y' + Z')

Boolean Algebra (Axioms)

(A1) X = 0 if X != 1 (A1') X = 1 if X != 0

(A2) If X = 0, then X' = 1 (A2') if X = 1, then X' = 0

(A3) 0 * 0 = 0 (A3') 1 + 1 = 1

(A4) 1 * 1 = 1 (A4') 0 + 0 = 0

(A5) 0 * 1 = 1 * 0 = 0 (A5') 1 + 0 = 0 + 1 = 1

Boolean Algebra (Postulates)● Commutative

A + B = B + A

A * B = B * A● Distributive

A * (B + C) = A * B + A * C

A + (B * C) = (A + B) * (A + C)

Pay attention to the second distributive

Boolean Algebra (Postulates)● Associative

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

(A * B) * C = A * (B * C)● Identity

0 + A = A + 0 = A

1 * A = A * 1 = A

Boolean Algebra (Postulates)● Complement

A + A' = 1

A * A' = 0

Boolean Algebra (Theorems)● Null Elements

A + 1 = 1

A * 0 = 0● Idempotent Law

A + A = A

A * A = A

Boolean Algebra (Theorems)● Involution Law

(A')' = A● DeMorgan's Law

(A + B)' = A'B'

(AB)' = A' + B'

DeMorgan's can be extended to more variables

Boolean Algebra (Theorems)● Covering

X + X * Y = X

X * (X + Y) = X● Combining

X * Y + X * Y' = X

(X + Y) * (X + Y') = X

Boolean Algebra (Theorems)● Consensus

X * Y + X' * Z + Y * Z = X * Y + X' * Z

(X + Y) * (X' + Z) * (Y + Z) = (X + Y) * (X' + Z)

Boolean Algebra

● Prove the following using algebraic manipulation

X'Y' + X'Y + XY = X' + Y

A'B + B'C' + AB + B'C = 1

Y + X'Z + XY' = X + Y + Z

X'Y' + Y'Z + XZ + XY + YZ' = X'Y' + XZ + YZ'

Boolean Algebra

● Prove the following using algebraic manipulation

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

Boolean Algebra

Given that A * B = 0 and A + B = 1, use algebraic manipulation to prove that

(A + C) * (A' + B) * (B + C) = B * C

Principle of Duality

● Any theorem or identity in Boolean Algebra remains true if 0 and 1 are swapped and the AND and OR operations are swapped throughout

Truth Tables

● A truth table may be expressed by many different equations.

● Prove two functions are equal by induction.● Optimizing a function usually requires

creating a truth table.

Standard Forms

A B C  MinTerm     MaxTerm

0 0 0  A'B'C' m0   A+B+C    M00 0 1  A'B'C  m1   A+B+C'   M10 1 0  A'BC'  m2   A+B'+C   M20 1 1  A'BC   m3   A+B'+C'  M31 0 0  AB'C'  m4   A'+B+C   M41 0 1  AB'C   m5   A'+B+C'  M51 1 0  ABC'   m6   A'+B'+C  M61 1 1  ABC    m7   A'+B'+C' M7

Standard Forms

● Sum of Minterms– Product terms

– Each term contains each variable.

– A term is one line or element on a truth table.

– For each line in a truth table that is 1, that term is part of the final equation.

– Write the Sum of Minterms for table 2.3 on page 67.

– Can be written as Σm(mx, my, ...)

Standard Forms

● Product of Maxterms– Sum terms.

– Each term contains each variable.

– A term is one line or element on a truth table.– For each line in a truth table that is 0, that term is part

of the final equation.

– Write the Product of Maxterms for table 2.3 on page 67.

– Can be written as ∏M(Mx, My, ...)

Combinational Logic Design Process● Create a truth table.● Write optimized equations. (We still need to

cover optimization in 6.2).● Draw schematic or create hardware

description from optimized equations.

Additional Gates

● NAND gate

Additional Gates

● NOR gate

Additional gates

● XOR gate (odd function)

Building Blocks

● Multiplexer

Building Blocks

● Decoder

Building Blocks

● Demultiplexer

Building Blocks

● Priority Encoder

Timing

● Real logic gates take time to react to an input change.

● The delay is called the propagation delay.● A complicated circuit may have “glitches” in its

output signals when the inputs change from one state to another.

● Reducing “glitches” often requires extra logic gates.

Optimization

● The second part of our design process.● Optimization criteria:

– Performance

– Size

– Power

Two-level Optimization

● Manipulating a function until it is in a minimized SOP or POS form.

● Minimizes the number of literals in an equation and results in a smaller circuit than a minimized sum-of-minterms or product of maxterms.

● Use Boolean Algebra● Use a Karnaugh Map

Karnaugh Maps (K-maps)

● A visual method.● Good for up to 4 variables. Difficult for 5 or 6

variables. Very difficult for more than 6 variables.

● Start with a truth table for your function.● A rectangular grid.● Number of squares is equal to the number of

lines in truth table.

K-Maps

● A two variable K-map.● Each square is a

minterm● Only one bit may

change between adjacent squares.

● Each side of map is a power of 2.

K-Maps

● 3 variable K-map● Map the equation

Σm(2,3,5,6)● Implicant – any

rectangular group of 1's where rectangle is a power of 2 on each side.

● Prime Implicant – An implicant that can't “grow larger”.

K-Maps

● Essential Prime Implicant – A prime implicant that has one square that is not part of another prime implicant.

● Non-essential Prime Implicant – A prime implicant where every one of its squares is part of another prime implicant.

K-Maps

● An optimized SOP has all of the essential prime implicants. It may have non-essential prime implicants only if the essential prime implicants don't cover all squares.

● There can be more than one simplified SOP due to the selection of non-essential prime implicants.

K-Maps

● Determine essential and non-essential prime implicants:– Σm(1,2,3,5,8,9,11,15)

– Σm(5,7,9,13,14,15)

– Σm(0,1,3,4,6,9,11,14,15)

– Σm(1,5,13,14,15)

– Σm(2,3,5,7,8,10,12,13)

K-Maps

● Determine essential and non-essential prime implicants:– Σm(0,1,3,5,6,7,8,9,10,12,14,15)

– Σm(1,2,3,5,6,13,14,15)

K-Maps

● To create a simplified POS, select rectangular regions of 0's.

● These are called Implicates.● A simplified POS is made up of essential

prime implicates and maybe non-essential prime implicates.

● Map the equation ПM(0,1,4,6)

K-Maps

● Selecting the 0's as a minimized SOP gives the inverse of the function.

● Use Demorgan's Theorem to get the function and at the same time minimized POS form.

● Usually go straight from K-Map to minimized POS form.

K-Maps

● Determine essential and non-essential prime implicates:– ∏M(1,2,3,5,8,9,11,15)

– ∏M(5,7,9,13,14,15)

– ∏M(0,1,3,4,6,9,11,14,15)

– ∏M(1,5,13,14,15)

– ∏M(2,3,5,7,8,10,12,13)

K-Maps

● Determine essential and non-essential prime implicates:– ∏M(0,1,3,5,6,7,8,9,10,12,14,15)

– ∏M(1,2,3,5,6,13,14,15)

K-Maps

● Sometimes you don't care if a minTerm or maxTerm is a 0 or 1. We call these “don't cares”.

● Use them to your advantage to create larger prime implicants or implicates.– Σm(3,5,8,12), d(1,2,6,7,10,14)