Combinational Logic (mostly review!)

Similar documents
Possible logic functions of two variables

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

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

EECS Variable Logic Functions

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

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

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

Chapter 2 Combinational logic

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

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

Lecture A: Logic Design and Gates

Combinational Logic. Review of Combinational Logic 1

L2: Combinational Logic Design (Construction and Boolean Algebra)

Working with combinational logic

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

L2: Combinational Logic Design (Construction and Boolean Algebra)

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

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

L2: Combinational Logic Design (Construction and Boolean Algebra)

Chapter 2: Switching Algebra and Logic Circuits

Boolean Algebra. Boolean Variables, Functions. NOT operation. AND operation. AND operation (cont). OR operation

Switches: basic element of physical implementations

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

Week-I. Combinational Logic & Circuits

Logic Gates and Boolean Algebra

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

CS 121 Digital Logic Design. Chapter 2. Teacher Assistant. Hanin Abdulrahman

Part 5: Digital Circuits

ECE/Comp Sci 352 Digital System Fundamentals Quiz # 1 Solutions

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

Combinational Logic Design Principles

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

Outline. EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits) Combinational Logic (CL) Defined

Chapter 2: Princess Sumaya Univ. Computer Engineering Dept.

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

Digital Circuit And Logic Design I. Lecture 3

EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits)

ENG2410 Digital Design Combinational Logic Circuits

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

211: Computer Architecture Summer 2016

Chapter 2. Introduction. Chapter 2 :: Topics. Circuits. Nodes. Circuit elements. Introduction

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

Digital Logic & Computer Design CS Professor Dan Moldovan Spring 2010

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

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

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

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

Chapter # 3: Multi-Level Combinational Logic

Digital Logic & Computer Design CS Professor Dan Moldovan Spring Copyright 2007 Elsevier 2-<101>

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

Lecture 1. Notes. Notes. Notes. Introduction. Introduction digital logic February Bern University of Applied Sciences

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

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

CS 226: Digital Logic Design

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

COMP2611: Computer Organization. Introduction to Digital Logic

Combinatorial Logic Design Principles

CHAPTER 12 Boolean Algebra

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

Logic Design. Chapter 2: Introduction to Logic Circuits

COSC3330 Computer Architecture Lecture 2. Combinational Logic

Logic and Boolean algebra

Lecture 2 Review on Digital Logic (Part 1)

Appendix A: Digital Logic. Principles of Computer Architecture. Principles of Computer Architecture by M. Murdocca and V. Heuring

Contents. Chapter 2 Digital Circuits Page 1 of 30

Combinational Logic Fundamentals

Number System conversions

CHAPTER III BOOLEAN ALGEBRA

3. PRINCIPLES OF COMBINATIONAL LOGIC

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

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

Propositional Logic. Logical Expressions. Logic Minimization. CNF and DNF. Algebraic Laws for Logical Expressions CSC 173

ELEC Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3)

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

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

Chapter 3. Boolean Algebra. (continued)

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

UNIT 5 KARNAUGH MAPS Spring 2011

Boolean Algebra and Logic Simplification

MC9211 Computer Organization

CHAPTER III BOOLEAN ALGEBRA

1. Name the person who developed Boolean algebra

CHAPTER 7 MULTI-LEVEL GATE CIRCUITS NAND AND NOR GATES

ELEC Digital Logic Circuits Fall 2014 Logic Minimization (Chapter 3)

Chap 2. Combinational Logic Circuits

ELCT201: DIGITAL LOGIC DESIGN

Chapter 4 Optimized Implementation of Logic Functions

Digital- or Logic Circuits. Outline Logic Circuits. Logic Voltage Levels. Binary Representation

Digital Design 2. Logic Gates and Boolean Algebra

This form sometimes used in logic circuit, example:

DO NOT COPY DO NOT COPY

Chapter 2: Boolean Algebra and Logic Gates

CHAPTER1: Digital Logic Circuits Combination Circuits

Chapter 2 Boolean Algebra and Logic Gates

Chapter 2 Combinational Logic Circuits

14:332:231 DIGITAL LOGIC DESIGN

UNIT 4 MINTERM AND MAXTERM EXPANSIONS

Logic. Basic Logic Functions. Switches in series (AND) Truth Tables. Switches in Parallel (OR) Alternative view for OR

12/31/2010. Overview. 10-Combinational Circuit Design Text: Unit 8. Limited Fan-in. Limited Fan-in. Limited Fan-in. Limited Fan-in

Boolean Algebra, Gates and Circuits

Transcription:

ombinational Logic (mostly review!)! Logic functions, truth tables, and switches " NOT, N, OR, NN, NOR, OR,... " Minimal set! xioms and theorems of oolean algebra " Proofs by re-writing " Proofs by perfect induction! Gate logic " Networks of oolean functions " Time behavior! anonical forms " Two-level " Incompletely specified functions S 5 - Spring 27 Lec #2: ombinational Logic - Possible Logic Functions of Two Variables! 6 possible functions of 2 input variables: " 2**(2**n) functions of n inputs Y F Y 6 possible functions (F F5) and Y Y xor Y or Y = Y nor Y not ( or Y) not Y not nand Y not ( and Y) S 5 - Spring 27 Lec #2: ombinational Logic - 2

ost of ifferent Logic Functions! Some are easier, others harder, to implement " Each has a cost associated with the number of switches needed " (F) and (F5): require switches, directly connect output to low/high " (F3) and Y (F5): require switches, output is one of inputs " ' (F2) and Y' (F): require 2 switches for "inverter" or NOT-gate " nor Y (F4) and nand Y (F4): require 4 switches " or Y (F7) and and Y (F): require 6 switches " = Y (F9) and " Y (F6): require 6 switches " ecause NOT, NOR, and NN are the cheapest they are the functions we implement the most in practice S 5 - Spring 27 Lec #2: ombinational Logic - 3 Minimal Set of Functions! Implement any logic functions from NOT, NOR, and NN? " For example, implementing and Y is the same as implementing not ( nand Y)! o it with only NOR or only NN " NOT is just a NN or a NOR with both inputs tied together Y nor Y Y nand Y " and NN and NOR are "duals", i.e., easy to implement one using the other nand Y! not ( (not ) nor (not Y) ) nor Y! not ( (not ) nand (not Y) )! ased on the mathematical foundations of logic: oolean lgebra S 5 - Spring 27 Lec #2: ombinational Logic - 4

lgebraic Structure! onsists of " Set of elements " inary operations { +, } " Unary operation { ' } " Following axioms hold:. set contains at least two elements, a, b, such that a # b 2. closure: a + b is in a b is in 3. commutativity: a + b = b + a a b = b a 4. associativity: a + (b + c) = (a + b) + c a (b c) = (a b) c 5. Identity: a + = a a = a 6. distributivity: a + (b c) = (a + b) (a + c) a (b + c) = (a b) + (a c) 7. complementarity: a + a' = a a' = S 5 - Spring 27 Lec #2: ombinational Logic - 5 oolean lgebra! oolean algebra " = {, } " + is logical OR, is logical N " ' is logical NOT! ll algebraic axioms hold S 5 - Spring 27 Lec #2: ombinational Logic - 6

Logic Functions and oolean lgebra! ny logic function that can be expressed as a truth table can be written as an expression in oolean algebra using the operators: ', +, and Y!Y Y ' ' Y Y ' Y'!Y '!Y' (!Y ) + ( '!Y' ) (!Y ) + ( '!Y' )! =!Y, Y are oolean algebra variables S 5 - Spring 27 Lec #2: ombinational Logic - 7 oolean expression that is true when the variables and Y have the same value and false, otherwise xioms and Theorems of oolean lgebra! Identity. + =. =! Null 2. + = 2. =! Idempotency: 3. + = 3. =! Involution: 4. (')' =! omplementarity: 5. + ' = 5. ' =! ommutativity: 6. + Y = Y + 6. Y = Y! ssociativity: 7. ( + Y) + = + (Y + ) 7. ( Y) = (Y ) S 5 - Spring 27 Lec #2: ombinational Logic - 8

xioms and Theorems of oolean lgebra (cont d)! istributivity: 8. (Y + ) = ( Y) + ( ) 8. + (Y ) = ( + Y) ( + )! Uniting: 9. Y + Y' = 9. ( + Y) ( + Y') =! bsorption:. + Y =. ( + Y) =. ( + Y') Y = Y. ( Y') + Y = + Y! Factoring: 2. ( + Y) (' + ) = 2. Y + ' = + ' Y ( + ) (' + Y)! onsensus: 3. ( Y) + (Y ) + (' ) = 3. ( + Y) (Y + ) (' + ) = Y + ' ( + Y) (' + ) S 5 - Spring 27 Lec #2: ombinational Logic - 9 xioms and Theorems of oolean lgebra (cont d)! demorgan's: 4. ( + Y +...)' = ' Y'... 4. ( Y...)' = ' + Y' +...! Generalized de Morgan's: 5. f'(,2,...,n,,,+, ) = f(',2',...,n',,,,+)! Establishes relationship between and + S 5 - Spring 27 Lec #2: ombinational Logic -

xioms and Theorems of oolean lgebra (cont d)! uality " ual of a oolean expression is derived by replacing by +, + by, by, and by, and leaving variables unchanged " ny theorem that can be proven is thus also proven for its dual! " Meta-theorem (a theorem about theorems)! uality: 6. + Y +... $ Y...! Generalized duality: 7. f (,2,...,n,,,+, ) $ f(,2,...,n,,,,+)! ifferent than demorgan s Law " This is a statement about theorems " This is not a way to manipulate (re-write) expressions S 5 - Spring 27 Lec #2: ombinational Logic - Proving Theorems (Rewriting Method)! Using the axioms of oolean algebra: " e.g., prove the theorem: Y + Y' = distributivity (8)!Y +!Y' = (Y + Y') complementarity (5) (Y + Y') =!() identity ()!() =! " e.g., prove the theorem: + Y = identity () + Y = + Y distributivity (8) + Y = ( + Y) identity (2) ( + Y) =!() identity () () =! S 5 - Spring 27 Lec #2: ombinational Logic - 2

Proving Theorems (Perfect Induction)! Using perfect induction (complete truth table): " e.g., de Morgan's: ( + Y)' = ' Y' NOR is equivalent to N with inputs complemented ( Y)' = ' + Y' NN is equivalent to OR with inputs complemented Y ' Y' ( + Y)' ' Y' Y ' Y' ( Y)' ' + Y' S 5 - Spring 27 Lec #2: ombinational Logic - 3 Simple Example! -bit binary adder " Inputs:,, arry-in " Outputs: Sum, arry-out in S out in S out S = ' ' in + ' in' + ' in' + in out = ' in + ' in + in' + in S 5 - Spring 27 Lec #2: ombinational Logic - 4

pply the Theorems to Simplify Expressions! Theorems of oolean algebra can simplify oolean expressions " e.g., full adder's carry-out function (same rules apply to any function) out = ' in + ' in + in' + in = ' in + ' in + in' + in + in = ' in + in + ' in + in' + in = (' + ) in + ' in + in' + in = () in + ' in + in' + in = in + ' in + in' + in + in = in + ' in + in + in' + in = in + (' + ) in + in' + in = in + () in + in' + in = in + in + (in' + in) = in + in + () = in + in + S 5 - Spring 27 Lec #2: ombinational Logic - 5 From oolean Expressions to Logic Gates! NOT ' ~ Y Y! N Y Y % Y! OR + Y & Y Y Y Y Y S 5 - Spring 27 Lec #2: ombinational Logic - 6

From oolean Expressions to Logic Gates (cont d)! NN Y Y! NOR! OR " Y! NOR = Y Y Y Y Y Y Y xor Y = Y' + ' Y or Y but not both ("inequality", "difference") xnor Y = Y + ' Y' and Y are the same ("equality", "coincidence") S 5 - Spring 27 Lec #2: ombinational Logic - 7 From oolean Expressions to Logic Gates (cont d)! More than one way to map expressions to gates T2 " e.g., = ' ' ( + ) = (' (' ( + ))) T use of 3-input gate T T2 S 5 - Spring 27 Lec #2: ombinational Logic - 8

Waveform View of Logic Functions! Just a sideways truth table " ut note how edges don't line up exactly " It takes time for a gate to switch its output! time change in Y takes time to "propagate" through gates S 5 - Spring 27 Lec #2: ombinational Logic - 9 hoosing ifferent Realizations of a Function two-level realization (we don't count NOT gates) multi-level realization (gates with fewer inputs) OR gate (easier to draw but costlier to build) S 5 - Spring 27 Lec #2: ombinational Logic - 2

Which Realization is est?! Reduce number of inputs " literal: input variable (complemented or not) # can approximate cost of logic gate as 2 transistors per literal # why not count inverters? " Fewer literals means less transistors # smaller circuits " Fewer inputs implies faster gates # gates are smaller and thus also faster " Fan-ins (# of gate inputs) are limited in some technologies! Reduce number of gates " Fewer gates (and the packages they come in) means smaller circuits # directly influences manufacturing costs S 5 - Spring 27 Lec #2: ombinational Logic - 2 Which is the est Realization? (cont d)! Reduce number of levels of gates " Fewer level of gates implies reduced signal propagation delays " Minimum delay configuration typically requires more gates # wider, less deep circuits! How do we explore tradeoffs between increased circuit delay and size? " utomated tools to generate different solutions " Logic minimization: reduce number of gates and complexity " Logic optimization: reduction while trading off against delay S 5 - Spring 27 Lec #2: ombinational Logic - 22

re ll Realizations Equivalent?! Under the same inputs, the alternative implementations have almost the same waveform behavior " elays are different " Glitches (hazards) may arise " Variations due to differences in number of gate levels and structure! Three implementations are functionally equivalent S 5 - Spring 27 Lec #2: ombinational Logic - 23 Implementing oolean Functions! Technology independent " anonical forms " Two-level forms " Multi-level forms! Technology choices " Packages of a few gates " Regular logic " Two-level programmable logic " Multi-level programmable logic S 5 - Spring 27 Lec #2: ombinational Logic - 24

anonical Forms! Truth table is the unique signature of a oolean function! Many alternative gate realizations may have the same truth table! anonical forms " Standard forms for a oolean expression " Provides a unique algebraic signature S 5 - Spring 27 Lec #2: ombinational Logic - 25 Sum-of-Products anonical Forms! lso known as disjunctive normal form! lso known as minterm expansion F = F = ''+ ' + ' + ' + F F' F' = ''' + '' + '' S 5 - Spring 27 Lec #2: ombinational Logic - 26

Sum-of-Products anonical Form (cont d)! Product term (or minterm) " Ned product of literals input combination for which output is true " Each variable appears exactly once, in true or inverted form (but not both) minterms ''' m '' m '' m2 ' m3 '' m4 ' m5 ' m6 m7 short-hand notation for minterms of 3 variables F in canonical form: F(,, ) = 'm(,3,5,6,7) = m + m3 + m5 + m6 + m7 = '' + ' + ' + ' + canonical form # minimal form F(,, ) = '' + ' + ' + + ' = ('' + ' + ' + ) + ' = ((' + )(' + )) + ' = + ' = ' + = + S 5 - Spring 27 Lec #2: ombinational Logic - 27 Product-of-Sums anonical Form! lso known as conjunctive normal form! lso known as maxterm expansion F F' F = F = ( + + ) ( + ' + ) (' + + ) F' = ( + + ') ( + ' + ') (' + + ') (' + ' + ) (' + ' + ') S 5 - Spring 27 Lec #2: ombinational Logic - 28

Product-of-Sums anonical Form (cont d)! Sum term (or maxterm) " ORed sum of literals input combination for which output is false " Each variable appears exactly once, in true or inverted form (but not both) maxterms ++ M ++' M +'+ M2 +'+' M3 '++ M4 '++' M5 '+'+ M6 '+'+' M7 F in canonical form: F(,, ) = (M(,2,4) = M M2 M4 = ( + + ) ( + ' + ) (' + + ) canonical form # minimal form F(,, ) = ( + + ) ( + ' + ) (' + + ) = ( + + ) ( + ' + ) ( + + ) (' + + ) = ( + ) ( + ) short-hand notation for maxterms of 3 variables S 5 - Spring 27 Lec #2: ombinational Logic - 29 S-o-P, P-o-S, and demorgan s Theorem! Sum-of-products " F' = ''' + '' + ''! pply de Morgan's " (F')' = (''' + '' + '')' " F = ( + + ) ( + ' + ) (' + + )! Product-of-sums " F' = ( + + ') ( + ' + ') (' + + ') (' + ' + ) (' + ' + ')! pply de Morgan's " (F')' = ( ( + + ')( + ' + ')(' + + ')(' + ' + )(' + ' + ') )' " F = '' + ' + ' + ' + S 5 - Spring 27 Lec #2: ombinational Logic - 3

Four lternative Two-level Implementations of F = + F canonical sum-of-products minimized sum-of-products F2 F3 canonical product-of-sums F4 minimized product-of-sums S 5 - Spring 27 Lec #2: ombinational Logic - 3 Waveforms for the Four lternatives! Waveforms are essentially identical " Except for timing hazards (glitches) " elays almost identical (modeled as a delay per level, not type of gate or number of inputs to gate) S 5 - Spring 27 Lec #2: ombinational Logic - 32

Mapping etween anonical Forms! Minterm to maxterm conversion " Use maxterms whose indices do not appear in minterm expansion " e.g., F(,,) = 'm(,3,5,6,7) = (M(,2,4)! Maxterm to minterm conversion " Use minterms whose indices do not appear in maxterm expansion " e.g., F(,,) = (M(,2,4) = 'm(,3,5,6,7)! Minterm expansion of F to minterm expansion of F' " Use minterms whose indices do not appear " e.g., F(,,) = 'm(,3,5,6,7) F'(,,) = 'm(,2,4)! Maxterm expansion of F to maxterm expansion of F' " Use maxterms whose indices do not appear " e.g., F(,,) = (M(,2,4) F'(,,) = (M(,3,5,6,7) S 5 - Spring 27 Lec #2: ombinational Logic - 33 Incompletely Specified Functions! Example: binary coded decimal increment by " digits encode decimal digits 9 in bit patterns W Y off-set of W on-set of W don't care () set of W these inputs patterns should never be encountered in practice "don't care" about associated output values, can be exploited in minimization S 5 - Spring 27 Lec #2: ombinational Logic - 34

Notation for Incompletely Specified Functions! on't cares and canonical forms " So far, only represented on-set " lso represent don't-care-set " Need two of the three sets (on-set, off-set, dc-set)! anonical representations of the increment by function: " = m + m2 + m4 + m6 + m8 + d + d + d2 + d3 + d4 + d5 " = ' [ m(,2,4,6,8) + d(,,2,3,4,5) ] " = M M3 M5 M7 M9 2 3 4 5 " = ( [ M(,3,5,7,9) (,,2,3,4,5) ] S 5 - Spring 27 Lec #2: ombinational Logic - 35 Simplification of Two-level ombinational Logic! Finding a minimal sum of products or product of sums realization " Exploit don't care information in the process! lgebraic simplification " Not an algorithmic/systematic procedure " How do you know when the minimum realization has been found?! omputer-aided design tools " Precise solutions require very long computation times, especially for functions with many inputs (> ) " Heuristic methods employed "educated guesses" to reduce amount of computation and yield good if not best solutions! Hand methods still relevant " Understand automatic tools and their strengths and weaknesses " bility to check results (on small examples) S 5 - Spring 27 Lec #2: ombinational Logic - 36

dministrative nnouncement! Labs and discussions start in 25 ory next week! on t forget: Lab lecture TOMORROW 2-3 pm! We will try to accommodate all wait-listed students! Lab sections posted on 25 ory and the Web by Monday @ 5 PM S 5 - Spring 27 Lec #2: ombinational Logic - 37 The Uniting Theorem! Key tool for simplification: (' + ) =! Essence of simplification: " 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 has the same value in both on-set rows! remains has a different value in the two rows! is eliminated S 5 - Spring 27 Lec #2: ombinational Logic - 38

oolean ubes! Visual technique for indentifying when the uniting theorem can be applied! n input variables = n-dimensional "cube" -cube Y 2-cube 3-cube Y Y W 4-cube S 5 - Spring 27 Lec #2: ombinational Logic - 39 Mapping Truth Tables onto oolean ubes! Uniting theorem combines two "faces" of a cube into a larger "face"! Example: F F two faces of size (nodes) combine into a face of size (line) ON-set = solid nodes OFF-set = empty nodes -set = )'d nodes varies within face, does not this face represents the literal ' S 5 - Spring 27 Lec #2: ombinational Logic - 4

Three Variable Example! inary full-adder carry-out logic in out ('+)in (in'+in) (+')in the on-set is completely covered by the combination (OR) of the subcubes of lower dimensionality - note that is covered three times out = in++in S 5 - Spring 27 Lec #2: ombinational Logic - 4 Higher imensional ubes! Sub-cubes of higher dimension than 2 F(,,) = 'm(4,5,6,7) on-set forms a square i.e., a cube of dimension 2 represents an expression in one variable i.e., 3 dimensions 2 dimensions is asserted (true) and unchanged and vary This subcube represents the literal S 5 - Spring 27 Lec #2: ombinational Logic - 42

m-imensional ubes in an n-imensional oolean Space! In a 3-cube (three variables): " -cube, i.e., a single node, yields a term in 3 literals " -cube, i.e., a line of two nodes, yields a term in 2 literals " 2-cube, i.e., a plane of four nodes, yields a term in literal " 3-cube, i.e., a cube of eight nodes, yields a constant term ""! In general, " m-subcube within an n-cube (m < n) yields a term with n m literals S 5 - Spring 27 Lec #2: ombinational Logic - 43 Karnaugh Maps! Flat map of oolean cube " Wrap around at edges " Hard to draw and visualize for more than 4 dimensions " Virtually impossible for more than 6 dimensions! lternative to truth-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 2 3 F S 5 - Spring 27 Lec #2: ombinational Logic - 44

Karnaugh Maps (cont d)! Numbering scheme based on Gray code " e.g.,,,, " Only a single bit changes in code for adjacent map cells 2 3 6 4 7 5 4 5 2 8 3 9 2 3 6 4 7 5 3 7 2 6 5 4 3 = = S 5 - Spring 27 Lec #2: ombinational Logic - 45 djacencies in Karnaugh Maps! Wrap from first to last column! Wrap top row to bottom row S 5 - Spring 27 Lec #2: ombinational Logic - 46

Karnaugh Map Examples! F =! out =! f(,,) = 'm(,4,6,7) + in + in in + + obtain the complement of the function by covering s with subcubes S 5 - Spring 27 Lec #2: ombinational Logic - 47 More Karnaugh Map Examples G(,,) = F(,,) = 'm(,4,5,7) = + F' simply replace 's with 's and vice versa F'(,,) = ' m(,2,3,6) = + S 5 - Spring 27 Lec #2: ombinational Logic - 48

Karnaugh Map: 4-Variable Example! F(,,,) = 'm(,2,3,5,6,7,8,,,4,5) F = + + find the smallest number of the largest possible subcubes to cover the ON-set (fewer terms with fewer inputs per term) S 5 - Spring 27 Lec #2: ombinational Logic - 49 Karnaugh Maps: on t ares! f(,,,) = ' m(,3,5,7,9) + d(6,2,3) " without don't cares # f = + S 5 - Spring 27 Lec #2: ombinational Logic - 5

Karnaugh Maps: on t ares (cont d)! f(,,,) = ' m(,3,5,7,9) + d(6,2,3) " f = ' + '' without don't cares " f = ' + ' with don't cares by using don't care as a "" a 2-cube can be formed rather than a -cube to cover this node don't cares can be treated as s or s depending on which is more advantageous S 5 - Spring 27 Lec #2: ombinational Logic - 5 esign Example: Two-bit omparator N N2 LT EQ GT block diagram and truth table < = > LT EQ GT we'll need a 4-variable Karnaugh map for each of the 3 output functions S 5 - Spring 27 Lec #2: ombinational Logic - 52

esign Example: Two-bit omparator (cont d) K-map for LT K-map for EQ K-map for GT LT = EQ = GT = ' ' + ' + ' '''' + '' + + ' ' ' + ' + ' = ( xnor ) ( xnor ) LT and GT are similar (flip / and /) S 5 - Spring 27 Lec #2: ombinational Logic - 53 esign Example: Two-bit omparator (cont d) two alternative implementations of EQ with and without OR EQ EQ NOR is implemented with at least 3 simple gates S 5 - Spring 27 Lec #2: ombinational Logic - 54

esign Example: 2x2-bit Multiplier 2 2 block diagram and truth table P P2 P4 P8 2 2 P8 P4 P2 P 4-variable K-map for each of the 4 output functions S 5 - Spring 27 Lec #2: ombinational Logic - 55 esign Example: 2x2-bit Multiplier (cont d) 2 K-map for P8 K-map for P4 2 P4 = 22' + 2'2 2 P8 = 22 2 2 K-map for P2 K-map for P P = 2 2 P2 = 2'2 + 2' + 22' + 2' 2 S 5 - Spring 27 Lec #2: ombinational Logic - 56

esign Example: Increment by I I2 I4 I8 block diagram and truth table O O2 O4 O8 I8 I4 I2 I O8 O4 O2 O 4-variable K-map for each of the 4 output functions S 5 - Spring 27 Lec #2: ombinational Logic - 57 esign Example: Increment by (cont d) I8 O8 O4 I8 I2 I4 I O8 = I4 I2 I + I8 I' O4 = I4 I2' + I4 I' + I4 I2 I O2 = I8 I2 I + I2 I' I2 I4 I I8 O2 O = I' O I8 I I I2 I2 I4 I4 S 5 - Spring 27 Lec #2: ombinational Logic - 58

efinition of Terms for Two-level Simplification! Implicant " Single element of ON-set or -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 " -set used to form prime implicants but not to make implicant essential! Objective: " Grow implicant into prime implicants (minimize literals per term) " over the ON-set with as few prime implicants as possible (minimize number of product terms) S 5 - Spring 27 Lec #2: ombinational Logic - 59 Examples to Illustrate Terms 6 prime implicants: '', ',, '',, ' essential minimum cover: + ' + '' 5 prime implicants:, ',, ', '' essential minimum cover: 4 essential implicants S 5 - Spring 27 Lec #2: ombinational Logic - 6

lgorithm for Two-level Simplification! lgorithm: minimum sum-of-products expression from a K-map " Step : choose an element of the ON-set " Step 2: find "maximal" groupings of s and s 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 and 2 to find all prime implicants " Step 3: revisit the s in the K-map # if covered by single prime implicant, it is essential, participates in final cover # s covered by essential prime implicant do not need to be revisited " Step 4: if there remain s not covered by essential prime implicants # select the smallest number of prime implicants that cover the remaining s S 5 - Spring 27 Lec #2: ombinational Logic - 6 lgorithm for Two-level Simplification (example) 2 primes around ''' 2 primes around ' 3 primes around ''' 2 essential primes minimum cover (3 primes) S 5 - Spring 27 Lec #2: ombinational Logic - 62

Implementations of Two-level Logic! Sum-of-products " N gates to form product terms (minterms) " OR gate to form sum! Product-of-sums " OR gates to form sum terms (maxterms) " N gates to form product S 5 - Spring 27 Lec #2: ombinational Logic - 63 Two-level Logic Using NN Gates! Replace minterm N gates with NN gates! Place compensating inversion at inputs of OR gate S 5 - Spring 27 Lec #2: ombinational Logic - 64

Two-level Logic Using NN Gates (cont d)! OR gate with inverted inputs is a NN gate " de Morgan's: ' + ' = ( )'! Two-level NN-NN network " Inverted inputs are not counted " In a typical circuit, inversion is done once and signal distributed S 5 - Spring 27 Lec #2: ombinational Logic - 65 Two-level Logic Using NOR Gates! Replace maxterm OR gates with NOR gates! Place compensating inversion at inputs of N gate S 5 - Spring 27 Lec #2: ombinational Logic - 66

Two-level Logic Using NOR Gates (cont d)! N gate with inverted inputs is a NOR gate " de Morgan's: ' ' = ( + )'! Two-level NOR-NOR network " Inverted inputs are not counted " In a typical circuit, inversion is done once and signal distributed S 5 - Spring 27 Lec #2: ombinational Logic - 67 Two-level Logic Using NN and NOR Gates! NN-NN and NOR-NOR networks " de Morgan's law: ( + )' = ' ' ( )' = ' + ' " written differently: + = (' ') ( ) = (' + ')'! In other words " OR is the same as NN with complemented inputs " N is the same as NOR with complemented inputs " NN is the same as OR with complemented inputs " NOR is the same as N with complemented inputs OR OR N N NN NN NOR NOR S 5 - Spring 27 Lec #2: ombinational Logic - 68

onversion etween Forms! onvert from networks of Ns and ORs to networks of NNs and NORs " Introduce appropriate inversions ("bubbles")! Each introduced "bubble" must be matched by a corresponding "bubble" " onservation of inversions " o not alter logic function! Example: N/OR to NN/NN NN NN S 5 - Spring 27 Lec #2: ombinational Logic - 69 NN onversion etween Forms (cont d)! Example: verify equivalence of two forms NN NN NN = [ ( )' ( )' ]' = [ (' + ') (' + ') ]' = [ (' + ')' + (' + ')' ] = ( ) + ( )! S 5 - Spring 27 Lec #2: ombinational Logic - 7

onversion etween Forms (cont d)! Example: map N/OR network to NOR/NOR network NOR NOR \ \ \ \ NOR NOR NOR conserve "bubbles" Step Step 2 S 5 - Spring 27 Lec #2: ombinational Logic - 7 conserve "bubbles" onversion etween Forms (cont d)! Example: verify equivalence of two forms \ \ NOR NOR \ \ NOR = { [ (' + ')' + (' + ')' ]' }' = { (' + ') (' + ') }' = (' + ')' + (' + ')' = ( ) + ( )! S 5 - Spring 27 Lec #2: ombinational Logic - 72

ombinational Logic Summary! Logic functions, truth tables, and switches " NOT, N, OR, NN, NOR, OR,..., minimal set! xioms and theorems of oolean algebra " Proofs by re-writing and perfect induction! Gate logic " Networks of oolean functions and their time behavior! anonical forms " Two-level and incompletely specified functions! Simplification " Two-level simplification S 5 - Spring 27 Lec #2: ombinational Logic - 73