for Digital Systems Simplification of logic functions Tajana Simunic Rosing Sources: TSR, Katz, Boriello & Vahid

Similar documents
Boolean cubes EECS150. Mapping truth tables onto cubes. Simplification. The Uniting Theorem. Three variable example

Possible logic functions of two variables

Combinational Logic (mostly review!)

Ch 2. Combinational Logic. II - Combinational Logic Contemporary Logic Design 1

Review. EECS Components and Design Techniques for Digital Systems. Lec 06 Minimizing Boolean Logic 9/ Review: Canonical Forms

Working with Combinational Logic. Design example: 2x2-bit multiplier

Combinational logic. Possible logic functions of two variables. Minimal set of functions. Cost of different logic functions.

L2: Combinational Logic Design (Construction and Boolean Algebra)

L2: Combinational Logic Design (Construction and Boolean Algebra)

Combinational Logic. Review of Combinational Logic 1

Chapter 2 Combinational logic

EECS Variable Logic Functions

L2: Combinational Logic Design (Construction and Boolean Algebra)

Unit 2 Session - 6 Combinational Logic Circuits

Working with combinational logic

EECS150 - Digital Design Lecture 19 - Combinational Logic Circuits : A Deep Dive

Why digital? Overview. Number Systems. Binary to Decimal conversion

UNIT 5 KARNAUGH MAPS Spring 2011

211: Computer Architecture Summer 2016

CMSC 313 Lecture 19 Combinational Logic Components Programmable Logic Arrays Karnaugh Maps

Logic and Computer Design Fundamentals. Chapter 2 Combinational Logic Circuits. Part 2 Circuit Optimization

Simplifying Logic Circuits with Karnaugh Maps

Learning Objectives. Boolean Algebra. In this chapter you will learn about:

The Karnaugh Map COE 202. Digital Logic Design. Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals

UNIT 4 MINTERM AND MAXTERM EXPANSIONS

Chapter 4 Optimized Implementation of Logic Functions

ENG2410 Digital Design Combinational Logic Circuits

Combinational logic. Possible logic functions of two variables. Minimal set of functions. Cost of different logic functions

Chapter 7 Logic Circuits

This form sometimes used in logic circuit, example:

Show that the dual of the exclusive-or is equal to its compliment. 7

Karnaugh Maps Objectives

E&CE 223 Digital Circuits & Systems. Lecture Transparencies (Boolean Algebra & Logic Gates) M. Sachdev. Section 2: Boolean Algebra & Logic Gates

Lecture A: Logic Design and Gates

Karnaugh Maps ف ر آ ا د : ا ا ب ا م آ ه ا ن ر ا

Minimization techniques

ELCT201: DIGITAL LOGIC DESIGN

Simplification of Boolean Functions. Dept. of CSE, IEM, Kolkata

II. COMBINATIONAL LOGIC DESIGN. - algebra defined on a set of 2 elements, {0, 1}, with binary operators multiply (AND), add (OR), and invert (NOT):

CPE100: Digital Logic Design I

3. PRINCIPLES OF COMBINATIONAL LOGIC

Principles of Computer Architecture. Appendix B: Reduction of Digital Logic. Chapter Contents

Part 5: Digital Circuits

CHAPTER 5 KARNAUGH MAPS

CMSC 313 Lecture 19 Homework 4 Questions Combinational Logic Components Programmable Logic Arrays Introduction to Circuit Simplification

Number System conversions

Lecture 2 Review on Digital Logic (Part 1)

Chapter 2 Combinational Logic Circuits

ﻮﻧﺭﺎﮐ ﺔﺸﻘﻧ ﺎﺑ ﻱﺯﺎﺳ ﻪﻨﻴﻬﺑ

Goals for Lecture. Binary Logic and Gates (MK 2.1) Binary Variables. Notation Examples. Logical Operations

E&CE 223 Digital Circuits & Systems. Lecture Transparencies (Boolean Algebra & Logic Gates) M. Sachdev

14:332:231 DIGITAL LOGIC DESIGN. Combinational Circuit Synthesis

Digital Logic Design. Combinational Logic

Spiral 1 / Unit 5. Karnaugh Maps

Outcomes. Spiral 1 / Unit 5. Logic Function Synthesis KARNAUGH MAPS. Karnaugh Maps

CHAPTER III BOOLEAN ALGEBRA

CSE140: Components and Design Techniques for Digital Systems. Logic minimization algorithm summary. Instructor: Mohsen Imani UC San Diego

LOGIC GATES. Basic Experiment and Design of Electronics. Ho Kyung Kim, Ph.D.

Week-I. Combinational Logic & Circuits

L4: Karnaugh diagrams, two-, and multi-level minimization. Elena Dubrova KTH / ICT / ES

Outcomes. Spiral 1 / Unit 5. Logic Function Synthesis KARNAUGH MAPS. Karnaugh Maps

Review for Test 1 : Ch1 5

Midterm1 Review. Jan 24 Armita

Lecture 2. Notes. Notes. Notes. Boolean algebra and optimizing logic functions. BTF Electronics Fundamentals August 2014

CHAPTER 7. Solutions for Exercises

DIGITAL TECHNICS I. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute 5. LECTURE: LOGIC SYNTHESIS

Combinational Logic Circuits Part II -Theoretical Foundations

Theorem/Law/Axioms Over (.) Over (+)

Total Time = 90 Minutes, Total Marks = 50. Total /50 /10 /18

Chap 2. Combinational Logic Circuits

Lecture 6: Manipulation of Algebraic Functions, Boolean Algebra, Karnaugh Maps

Combinatorial Logic Design Principles

9.1. Unit 9. Implementing Combinational Functions with Karnaugh Maps or Memories

CHAPTER III BOOLEAN ALGEBRA

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 2 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

MC9211 Computer Organization

Ex: Boolean expression for majority function F = A'BC + AB'C + ABC ' + ABC.

Minimierung. Wintersemester 2018/19. Folien basierend auf Material von F. Vahid und S. Werner Vorlesender: Dr. Ing.

Logic Simplification. Boolean Simplification Example. Applying Boolean Identities F = A B C + A B C + A BC + ABC. Karnaugh Maps 2/10/2009 COMP370 1

DIGITAL ELECTRONICS & it0203 Semester 3

Slide Set 3. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary

Chapter 5. Digital systems. 5.1 Boolean algebra Negation, conjunction and disjunction

Prove that if not fat and not triangle necessarily means not green then green must be fat or triangle (or both).

Karnaugh Maps (K-Maps)

Optimizations and Tradeoffs. Combinational Logic Optimization

Contents. Chapter 3 Combinational Circuits Page 1 of 36

Lecture 6: Gate Level Minimization Syed M. Mahmud, Ph.D ECE Department Wayne State University

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

WEEK 3.1 MORE ON KARNAUGH MAPS

Logic Design Combinational Circuits. Digital Computer Design

CHAPTER 7. Exercises 17/ / /2 2 0

Karnaugh Map & Boolean Expression Simplification

14:332:231 DIGITAL LOGIC DESIGN

UNIVERSITI TENAGA NASIONAL. College of Information Technology

2009 Spring CS211 Digital Systems & Lab CHAPTER 2: INTRODUCTION TO LOGIC CIRCUITS

Boolean Algebra and Logic Simplification

Cs302 Quiz for MID TERM Exam Solved

12/31/2010. Overview. 05-Boolean Algebra Part 3 Text: Unit 3, 7. DeMorgan s Law. Example. Example. DeMorgan s Law

Combinational Logic Fundamentals

Binary logic consists of binary variables and logical operations. The variables are

Transcription:

SE140: omponents and Design Techniques for Digital Systems Simplification of logic functions Tajana Simunic Rosing 1

What we covered thus far: Number representations Where we are now inary, Octal, Hex, 1s & 2s complement ddition, subtraction, multiplication, division in binary oolean algebra Switches, MOS transistors, Delay What is next: Review of MOS transistors and gates Logic simplification 2

Making MOS gates 3

MOS Example 4

nother example 5

One more example 6

SE140: omponents and Design Techniques for Digital Systems ombinational functions Representations and Simplification Tajana Simunic Rosing Sources: 7

Logic Design Process: Three 1s Detector Problem: a Detect 3 consecutive 1s in 8-bit input: abcdefgh 00011101 01111000 10101011 Step 1: apture the function Truth table or equation? Truth table too big: 2^8=256 rows Equation: y = abc + bcd + cde +def+efg + efg + fgh a b c d abc bcd Step 2: Simplify if desired Step 3: Implement with gates e cde y f def g efg h fgh 8

anonical Form -- Sum of Minterms Truth tables are too big for numerous inputs Use standard form of equation instead Known as canonical form Regular algebra: group terms of polynomial by power ax 2 + bx + c (3x 2 + 4x + 2x 2 + 3 + 1 --> 5x 2 + 4x + 4) oolean algebra: create a sum of minterms Minterm: product term with every literal (e.g. a or a ) appearing exactly once Q: Determine if F(a,b)=ab+a is same function as F(a,b)=a b +a b+ab, by converting the first equation to canonical form 9

Sum-of-products canonical forms lso known as disjunctive normal form Minterm expansion: F = 001 011 101 1111 F = + + + + F F 1 1 1 0 1 1 1 0 1 1 1 0 1 1 0 1 1 1 1 0 F = + + 10

Sum-of-products canonical form (cont d) Product minterm NDed product of literals input combination for which output is 1 each variable appears exactly once, true or inverted (but not both) minterms 0 m0 1 m1 0 m2 1 m3 1 m4 1 m5 1 1 0 m6 1 1 1 m7 short-hand notation for minterms of 3 variables F in canonical form: F(,, ) = Σm(1,3,5,6,7) = m1 + m3 + m5 + m6 + m7 = + + + + canonical form minimal form F(,, ) = + + + + = ( + + + ) + = (( + )( + )) + = + = + = + 11

Product-of-sums canonical form lso known as conjunctive normal form lso known as maxterm expansion Implements zeros of a function F F 1 1 1 0 1 1 1 0 1 1 1 0 1 1 0 1 1 1 1 0 F = 00100 F = ( + + ) ( + + ) ( + + ) F = ( + + ) ( + + ) ( + + ) ( + + ) ( + + ) 12

Product-of-sums canonical form (cont d) Sum term (or maxterm) ORed sum of literals input combination for which output is false each variable appears exactly once, true or inverted (but not both) maxterms 0 ++ M0 1 ++ M1 0 + + M2 1 + + M3 1 ++ M4 1 ++ M5 1 1 0 + + M6 1 1 1 + + M7 short-hand hand notation for maxterms of 3 variables F in canonical form: F(,, ) = ΠM(0,2,4) = M0 M2 M4 = ( + + ) ( + + ) ( + + ) canonical form minimal form F(,, ) = ( + + ) ( + + ) ( + + ) = ( + + ) ( + + ) ( + + ) ( + + ) = ( + ) ( + ) 13

S-o-P, P-o-S, and de Morgan s theorem Sum-of-products F = + + pply de Morgan s (F ) = =( ( + + ) F = ( + + ) ( + + ) ( + + ) Product-of-sums F = ( + + ) ( + + ) ( + + ) ( + + ) ( + + ) pply de Morgan s (F ) = ( ( + + )( + + )( + + )( + + )( + + ) ) F = + + + + 14

Mapping between canonical forms Minterm to maxterm conversion use maxterms whose indices do not appear in minterm expansion e.g., F(,,) = Σm(1,3,5,6,7) = ΠM(0,2,4) Maxterm to minterm conversion use minterms whose indices do not appear in maxterm expansion e.g., F(,,) = ΠM(0,2,4) = Σm(1,3,5,6,7) Minterm expansion of F to minterm expansion of F use minterms whose indices do not appear e.g., F(,,) = Σm(1,3,5,6,7) F (,,) = Σm(0,2,4) Maxterm expansion of F to maxterm expansion of F use maxterms whose indices do not appear e.g., F(,,) = ΠM(0,2,4) F (,,) = ΠM(1,3,5,6,7) 15

Incompletely specified functions Example: binary coded decimal increment by 1 D digits encode the decimal digits 0 9 D W X Y Z 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 0 X X X X 1 1 X X X X 1 1 X X X X 1 1 X X X X 1 1 1 0 X X X X 1 1 1 1 X X X X Don t cares and canonical forms so far, only represented on-set also represent don t-care-set need two of the three sets (on-set, off-set, dc-set) off-set of W on-set of W don t care (D) set of W these inputs patterns should never be encountered in practice "don t care" about associated output values, can be exploited in minimization 16

lternative two-level implementations of F = + F1 F2 canonical sum-of-products minimized sum-of-products F3 canonical product-of-sums F4 minimized product-of-sums o s 17

SE140: omponents and Design Techniques for Digital Systems Logic simplification Tajana Simunic Rosing 18 Sources:

Simplification of two-level combinational logic Finding a minimal sum of products or product of sums realization exploit don t care information in the process lgebraic simplification not a systematic procedure how do you know when the minimum i realization has been found? omputer-aided design tools precise solutions require very long computation times, especially for functions with many inputs (> 10) heuristic methods employed "educated guesses" to reduce amount of computation and yield good if not best solutions Hand methods still relevant to understand automatic tools and their strengths and weaknesses ability to check results (on small examples) 19

The uniting theorem Key tool to simplification: ( + ) = Essence of simplification of two-level logic find two element subsets of the ON-set where only one variable changes its value this single varying variable can be eliminated and a single product term used to represent both elements F = + = ( +) = F 1 0 1 1 1 0 has the same value in both on-set rows remains has a different value in the two rows is eliminated 20

oolean cubes Visual technique for applying the uniting theorem n input variables = n-dimensional "cube" 1-cube X 01 11 Y 00 X 10 2-cube 111 1111 0111 3-cube Y 4-cube Z 101 Y Z 000 X W 1000 0000 X 21

Mapping truth tables onto oolean cubes Uniting theorem combines two faces" of a cube into a larger face" Example: F 1 0 1 1 1 0 01 F 11 00 two faces of size 0 (nodes) combine into a face of size 1(line) ON-set = solid nodes OFF-set = empty nodes D-set = 'd nodes varies within face, does not this face represents the literal ' 22

Three variable example inary full-adder carry-out logic ('+)in in out 1 0 1 1 1 0 1 1 1 1 1 1 1 1 000 111 101 (in'+in) (+')in the on-set is completely covered by the combination (OR) of the subcubes b of lower dimensionality - note that 111 is covered three times out = in++in 23

Higher dimensional cubes Sub-cubes of higher dimension than 2 011 010 110 001 111 101 F(,,) = Σm(4,5,6,7) on-set forms a square -a cube of dimension ion 2 000 100 This subcube represents the literal In a 3-cube (three variables): a 0-cube, i.e., a single node, yields a term in 3 literals a 1-cube, i.e., a line of two nodes, yields a term in 2 literals a 2-cube, i.e., a plane of four nodes, yields a term in 1 literal a 3-cube, i.e., a cube of eight nodes, yields a constant t term "1" In general, an m-subcube within an n-cube (m < n) yields a term with n m literals 24

Flat map of oolean cube wrap around at edges Karnaugh maps hard to draw and visualize for more than 4 dimensions virtually impossible for more than 6 dimensions lternative e to truth-tables th tables to help visualize adjacencies guide to applying the uniting theorem on-set elements with only one variable changing value are adjacent unlike the situation in a linear truth-table 0 1 1 0 2 1 1 3 F 1 0 1 1 1 0 25

Karnaugh maps (cont d) Numbering scheme based on Gray code e.g., 00, 01, 11, 10 only a single bit changes in code for adjacent map cells 01 0 1 0 2 1 3 0 2 11 10 6 4 7 5 1 3 7 5 6 4 0 4 1 5 12 8 13 9 D 3 7 15 11 2 6 14 10 13 = 1101= D 26

djacencies in Karnaugh maps Wrap from first to last column Wrap top row to bottom row 0010 1100 010 011 110 111 001 011 111 101 001 101 000 100 27

Karnaugh map examples F = 1 1 out = 1 0 in 1 1 f()=σm(0457) f(,,) Σm(0,4,5,7) 01 11 10 0 1 0 2 6 4 1 3 7 5 1 1 1 1 28

More Karnaugh map examples 1 1 1 1 1 1 1 1 F(,,) = Σm(0,4,5,7) 1 1 1 0 F' simply replace 1's with 0's and vice versa F'(,,) = Σ 29

Karnaugh map: 4-variable example F(,,,D) = Σm(0,2,3,5,6,7,8,10,11,14,15) F = 1 0 1111 0111 1 1 1 1 1 1 1 1 D 0000 D 1000 find the smallest number of the largest possible subcubes to cover the ON-set (fewer terms with fewer inputs per term) 30

Karnaugh maps: don t cares f(,,,d) = Σ m(1,3,5,7,9) + d(6,12,13) without don't cares with don t cares f = f = X 0 X 0 1 1 X 1 1 1 0 X D 1 1 X 1 1 1 0 X D don't cares can be treated as 1s or 0s depending on which is more advantageous 31

Example F = Σ m(0, 2, 7, 8, 14, 15) + d(3, 6, 9, 12, 13) 1 0 X 1 1 0 X 1 X X X X D X 1 1 0 1 X 1 0 1 X 1 0 X 1 1 0 1 0 X 1 D X X X 1 1 0 1 X 1 0 D 32

Design example: two-bit comparator N1 N2 D LT < D EQ = D GT > D block diagram and truth table D LT EQ GT 0 1 0 1 1 0 1 1 1 1 1 0 1 1 0 1 1 1 0 0 0 0 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 0 we'll need a 4-variable Karnaugh map for each of the 3 output t functions 33

Design example: two-bit comparator (cont d) 1 0 1 1 1 0 D D 1 1 D 1 1 1 1 1 0 1 0 K-map for LT K-map for EQ K-map for GT LT = EQ = GT = ' ' D + ' + ' D ' ' ' D' + ' ' D + D + ' D = ( xnor ) ( xnor D) ' D' + ' + D' LT and GT are similar (flip / and /D) 34

Design example: 2x2-bit multiplier 2 1 2 1 P8 P4 P2 P1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 P1 1 0 1 0 0 0 2 P2 1 0 1 P4 1 1 1 1 2 P8 1 0 1 0 1 1 1 1 1 0 1 1 block diagram 1 1 and 1 1 1 0 truth table 1 1 1 1 4-variable K-map for each of the 4 output functions 35

Design example: 2x2-bit multiplier (cont d) 2 K-map for P8 K-map for P4 2 1 1 2 1 0 2 1 1 1 1 2 2 K-map for P2 K-map for P1 1 1 1 1 0 1 2 1 0 2 1 0 1 1 36

Design example: D + 1 I8 I4 I2 I1 O8 O4 O2 O1 1 0 1 1 1 1 I1 O1 1 0 I2 O2 1 1 1 1 I4 O4 1 1 1 0 1 1 I8 O8 1 1 1 0 X X X X 1 1 X X X X 1 1 X X X X 1 1 X X X X block diagram 1 1 1 0 X X X X and 1 1 1 1 X X X X truth table 4-variable K-map for each of the 4 output functions 37

Design example: D + 1 (cont d) I8 X 1 O8 O4 I8 X 0 X 0 I1 X 0 I1 I2 X X X X I2 1 0 X X X X I4 I4 I8 X 0 O2 O1 1 1 I8 X 1 1 1 X 0 I1 X 0 I1 I2 X X 1 1 X X I2 X X 1 1 X X I4 I4 38

lgorithms for simplification & logic realization Simplification two-level simplification exploiting don t cares Logic realization two-level logic and canonical forms realized with NNDs and NORs multi-level logic, converting between NDs and ORs 39

Definition of terms for two-level simplification Implicant single element of ON-set or D-set or any group of these elements that can be combined to form a subcube Prime implicant implicant that can't be combined with another to form a larger subcube Essential prime implicant prime implicant is essential if it alone covers an element of ON-set will participate in LL possible covers of the ON-set D-set used to form prime implicants but not to make implicant essential Objective: grow implicant into prime implicants (minimize literals per term) cover the ON-set with as few prime implicants as possible (minimize number of product terms) 40

Examples to illustrate terms 0 X 1 0 1 1 1 0 1 0 1 1 1 1 D 6 prime implicants: ''D, ',, ''D,, 'D essential minimum cover: + ' + ''D 5 prime implicants: 1 0 D, ', D,', ''D 1 1 1 0 D essential minimum cover: 4 essential implicants 1 1 41

lgorithm for two-level simplification lgorithm: minimum sum-of-products expression from a Karnaugh map Step 1: choose an element of the ON-set Step 2: find "maximal" groupings of 1s and Xs adjacent to that element consider top/bottom row, left/right column, and corner adjacencies this forms prime implicants (number of elements always a power of 2) Repeat Steps 1 and 2 to find all prime implicants Step 3: revisit the 1s in the K-map if covered by single prime implicant, it is essential, and participates in final cover 1s covered by essential prime implicant do not need to be revisited Step 4: if there remain 1s not covered by essential prime implicants select the smallest number of prime implicants that cover the remaining 1s 42

lgorithm for two-level simplification (example) X 1 X 1 X 1 1 1 0 X X 0 D 1 1 0 X X 0 D 2 primes around ''D' 1 1 0 X X 0 2 primes around 'D D X 1 X 1 X 1 1 1 0 X X 0 D 1 1 0 X X 0 D 1 1 0 X X 0 3 primes around ''D' 2 essential primes minimum cover (3 primes) 43 D

Example List all prime implicants for the following K-map: X 0 X 0 X 1 0 X X 0 X 1 1 1 D Which are essential prime implicants? What is the minimum cover? 44

What we covered thus far: Number representations Switches MOS transistors Logic gates oolean algebra Logic representations SOP and POS K-maps lgorithm for simplification Summary 45