Digital Design. Chapter 6: Optimizations and Tradeoffs

Similar documents
Introduction to Computer Engineering EECS 203 dickrp/eecs203/ CMOS transmission gate (TG) TG example

Chapter 1: Introduction

MATH 25 CLASS 5 NOTES, SEP

Unit #9 : Definite Integral Properties, Fundamental Theorem of Calculus

1. SEQUENCES INVOLVING EXPONENTIAL GROWTH (GEOMETRIC SEQUENCES)

EECS 281: Homework #4 Due: Thursday, October 7, 2004

INTRODUCTION TO SIMPLICIAL COMPLEXES

An Efficient Divide and Conquer Algorithm for Exact Hazard Free Logic Minimization

ECE 468/573 Midterm 1 September 28, 2012

Stained Glass Design. Teaching Goals:

Digital Design. Chapter 1: Introduction. Digital Design. Copyright 2006 Frank Vahid

Tree Structured Symmetrical Systems of Linear Equations and their Graphical Solution

Math 464 Fall 2012 Notes on Marginal and Conditional Densities October 18, 2012

12-B FRACTIONS AND DECIMALS

2 Computing all Intersections of a Set of Segments Line Segment Intersection

Angle properties of lines and polygons

Engineer To Engineer Note

What do all those bits mean now? Number Systems and Arithmetic. Introduction to Binary Numbers. Questions About Numbers

Section 10.4 Hyperbolas

Scanner Termination. Multi Character Lookahead. to its physical end. Most parsers require an end of file token. Lex and Jlex automatically create an

4452 Mathematical Modeling Lecture 4: Lagrange Multipliers

Theory of Computation CSE 105

Integration. September 28, 2017

9.1 apply the distance and midpoint formulas

Questions About Numbers. Number Systems and Arithmetic. Introduction to Binary Numbers. Negative Numbers?

Integration. October 25, 2016

1 Drawing 3D Objects in Adobe Illustrator

What do all those bits mean now? Number Systems and Arithmetic. Introduction to Binary Numbers. Questions About Numbers

Matrices and Systems of Equations

COMP 423 lecture 11 Jan. 28, 2008

6.2 Volumes of Revolution: The Disk Method

Before We Begin. Introduction to Spatial Domain Filtering. Introduction to Digital Image Processing. Overview (1): Administrative Details (1):

MATH 2530: WORKSHEET 7. x 2 y dz dy dx =

Lecture 10 Evolutionary Computation: Evolution strategies and genetic programming

Parallel Square and Cube Computations

Constrained Optimization. February 29

Homework. Context Free Languages III. Languages. Plan for today. Context Free Languages. CFLs and Regular Languages. Homework #5 (due 10/22)

Systems I. Logic Design I. Topics Digital logic Logic gates Simple combinational logic circuits

Improper Integrals. October 4, 2017

Unit 5 Vocabulary. A function is a special relationship where each input has a single output.

Study Guide for Exam 3

Chapter 2 Sensitivity Analysis: Differential Calculus of Models

MA1008. Calculus and Linear Algebra for Engineers. Course Notes for Section B. Stephen Wills. Department of Mathematics. University College Cork

Fig.25: the Role of LEX

The Reciprocal Function Family. Objectives To graph reciprocal functions To graph translations of reciprocal functions

2014 Haskell January Test Regular Expressions and Finite Automata

Section 3.1: Sequences and Series

In the last lecture, we discussed how valid tokens may be specified by regular expressions.

Transparent neutral-element elimination in MPI reduction operations

9 4. CISC - Curriculum & Instruction Steering Committee. California County Superintendents Educational Services Association

ECEN 468 Advanced Logic Design Lecture 36: RTL Optimization

a < a+ x < a+2 x < < a+n x = b, n A i n f(x i ) x. i=1 i=1

On the Detection of Step Edges in Algorithms Based on Gradient Vector Analysis

Math 142, Exam 1 Information.

Basics of Logic Design Arithmetic Logic Unit (ALU)

such that the S i cover S, or equivalently S

CS201 Discussion 10 DRAWTREE + TRIES

10.5 Graphing Quadratic Functions

Assignment 4. Due 09/18/17

Solutions to Math 41 Final Exam December 12, 2011

x )Scales are the reciprocal of each other. e

If you are at the university, either physically or via the VPN, you can download the chapters of this book as PDFs.

CS143 Handout 07 Summer 2011 June 24 th, 2011 Written Set 1: Lexical Analysis

CSE 401 Midterm Exam 11/5/10 Sample Solution

CS311H: Discrete Mathematics. Graph Theory IV. A Non-planar Graph. Regions of a Planar Graph. Euler s Formula. Instructor: Işıl Dillig

Representation of Numbers. Number Representation. Representation of Numbers. 32-bit Unsigned Integers 3/24/2014. Fixed point Integer Representation

Today. Search Problems. Uninformed Search Methods. Depth-First Search Breadth-First Search Uniform-Cost Search

Dynamic Programming. Andreas Klappenecker. [partially based on slides by Prof. Welch] Monday, September 24, 2012

Fig.1. Let a source of monochromatic light be incident on a slit of finite width a, as shown in Fig. 1.

A New Learning Algorithm for the MAXQ Hierarchical Reinforcement Learning Method

Misrepresentation of Preferences

CS2204 DIGITAL LOGIC & STATE MACHINE DESIGN SPRING 2014

L2-Python-Data-Structures

Essential Question What are some of the characteristics of the graph of a rational function?

Creating Flexible Interfaces. Friday, 24 April 2015

50 AMC LECTURES Lecture 2 Analytic Geometry Distance and Lines. can be calculated by the following formula:

CSCI 446: Artificial Intelligence

TASK SPECIFIC DESCRIPTION

SOME EXAMPLES OF SUBDIVISION OF SMALL CATEGORIES

CS 130 : Computer Systems - II. Shankar Balachandran Dept. of Computer Science & Engineering IIT Madras

Small Business Networking

Fall 2018 Midterm 1 October 11, ˆ You may not ask questions about the exam except for language clarifications.

Midterm 2 Sample solution

Lecture T4: Pattern Matching

How to Design REST API? Written Date : March 23, 2015

Algorithm Design (5) Text Search

CHAPTER III IMAGE DEWARPING (CALIBRATION) PROCEDURE

Answer Key Lesson 6: Workshop: Angles and Lines

Small Business Networking

Approximation by NURBS with free knots

On Computation and Resource Management in Networked Embedded Systems

Rational Numbers---Adding Fractions With Like Denominators.

Functor (1A) Young Won Lim 10/5/17

File Manager Quick Reference Guide. June Prepared for the Mayo Clinic Enterprise Kahua Deployment

Register Transfer Level (RTL) Design

Revisiting the notion of Origin-Destination Traffic Matrix of the Hosts that are attached to a Switched Local Area Network

UNIT 11. Query Optimization

Solution of Linear Algebraic Equations using the Gauss-Jordan Method

CMPUT101 Introduction to Computing - Summer 2002

P(r)dr = probability of generating a random number in the interval dr near r. For this probability idea to make sense we must have

Transcription:

Digitl Design Chpter 6: Optimiztions nd Trdeoffs Slides to ccompny the tetbook Digitl Design, with RTL Design, VHDL, nd Verilog, 2nd Edition, by Frnk Vhid, John Wiley nd Sons Publishers, 2. http://www.ddvhid.com Frnk Vhid Instructors of courses requiring Vhid's Digitl Design tetbook (published by John Wiley nd Sons) hve permission to modify nd use these slides for customry course-relted ctivities, subject to keeping this copyright notice in plce nd unmodified. These slides my be posted s unnimted pdf versions on publicly-ccessible course websites.. PowerPoint source (or pdf with nimtions) Digitl my Design not be posted 2e to publicly-ccessible websites, but my be posted for students on internl protected sites or distributed directly to students by other electronic mens. Instructors my Copyright mke printouts 2 of the slides vilble to students for resonble photocopying chrge, without incurring roylties. Any other use requires eplicit permission. Instructors my obtin PowerPoint Frnk Vhid source or obtin specil use permissions from Wiley see http://www.ddvhid.com for informtion. You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

Krnugh Mps for Two-Level Size Optimiztion Esy to miss possible opportunities to combine terms when doing lgebriclly Krnugh Mps (K-mps) Grphicl method to help us find opportunities to combine terms Minterms differing in one vrible re djcent in the mp Cn clerly see opportunities to combine terms look for djcent s For F, clerly two opportunities Top left circle is shorthnd for: y z + y z = y (z +z) = y () = y Drw circle, write term tht hs ll the literls ecept the one tht chnges in the circle Circle y, = & y= in both cells of the circle, but z chnges (z= in one cell, in the other) Minimized function: OR the finl terms Digitl Design 2e Frnk Vhid Esier thn lgebriclly: F F F F = y z + + + y z F = y + y Notice not in binry order y z y y z y z y z Tret left & right s djcent too F = + + y z + y z F = y(z + z ) + y (z + z ) F = y* + y * F = y + y y K-mp 7 You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

K-mps Four djcent s mens two vribles cn be eliminted Mkes intuitive sense those two vribles pper in ll combintions, so one term must be true Drw one big circle shorthnd for the lgebric trnsformtions bove G = y z + y z + + G = (y z + y z + + ) (must be true) G = (y (z +z) + y(z+z )) G = (y +y) G = G Digitl Design 2e Frnk Vhid G Drw the biggest circle possible, or you ll hve more terms thn relly needed y y 8 You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

K-mps Four djcent cells cn be in shpe of squre OK to cover twice Just like duplicting term Remember, c + d = c + d + d No need to cover s more thn once Yields etr terms not minimized J y y z z H I H = y z + + y z + (y ppers in ll combintions) y z z The two circles re shorthnd for: I = y z + y z + y z + + I = y z + y z + y z + y z + + I = ( y z + y z) + (y z + y z + + ) I = (y z) + () Digitl Design 2e Frnk Vhid 9 You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

K-mps Circles cn cross left/right sides Remember, edges re djcent Minterms differ in one vrible only Circles must hve, 2, 4, or 8 cells 3, 5, or 7 not llowed 3/5/7 doesn t correspond to lgebric trnsformtions tht combine terms to eliminte vrible Circling ll the cells is OK K y z L E z Function just equls Digitl Design 2e Frnk Vhid You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

K-mps for Four Vribles Four-vrible K-mp follows sme principle Adjcent cells differ in one vrible Left/right djcent Top/bottom lso djcent 5 nd 6 vrible mps eist But hrd to use Two-vrible mps eist But not very useful esy to do lgebriclly by hnd F z y F w w y G w F=w y + Digitl Design 2e Frnk Vhid z G=z You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

Two-Level Size Optimiztion Using K-mps Generl K-mp method. Convert the function s eqution into sum-of-minterms form 2. Plce s in the pproprite K-mp cells for ech minterm 3. Cover ll s by drwing the fewest lrgest circles, with every included t lest once; write the corresponding term for ech circle 4. OR ll the resulting terms to crete the minimized function. Digitl Design 2e Frnk Vhid 2 You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

Two-Level Size Optimiztion Using K-mps Generl K-mp method. Convert the function s eqution into sum-of-minterms form 2. Plce s in the pproprite K-mp cells for ech minterm Common to revise () nd (2): Crete sum-of-products Drw s for ech product E: F = w'z + + w'y'z' F w w z w y z Digitl Design 2e Frnk Vhid 3 You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

Two-Level Size Optimiztion Using K-mps Generl K-mp method. Convert the function s eqution into sum-of-minterms form 2. Plce s in the pproprite K-mp cells for ech minterm 3. Cover ll s by drwing the fewest lrgest circles, with every included t lest once; write the corresponding term for ech circle Emple: Minimize: G = + b c + b*(c + bc ). Convert to sum-of-products G = + b c + bc + bc 2. Plce s in pproprite cells b c G bc bc 4. OR ll the resulting terms to crete the minimized function. 3. Cover s G bc c Digitl Design 2e Frnk Vhid 4. OR terms: G = + c 4 You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

Two-Level Size Optimiztion Using K-mps Minimize: H = b (cd + c d ) + b c d + b cd + bd + bcd. Convert to sum-of-products: H = b cd + b c d + b c d + b cd + bd + bcd 2. Plce s in K-mp cells 3. Cover s 4. OR resulting terms Four Vrible Emple H b b c d cd b c d b cd bd bcd b d bc bd b cd H = b d + bc + bd Funny-looking circle, but remember tht left/right djcent, nd top/bottom djcent Digitl Design 2e Frnk Vhid 5 You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

Don t Cre Input Combintions Wht if we know tht prticulr input combintions cn never occur? e.g., Minimize F = y z, given tht y z (=) cn never be true, nd tht y z (=) cn never be true So it doesn t mtter wht F outputs when y z or y z is true, becuse those cses will never occur Thus, mke F be or for those cses in wy tht best minimizes the eqution On K-mp Drw Xs for don t cre combintions Include X in circle ONLY if minimizes eqution Don t include other Xs Digitl Design 2e Frnk Vhid F y z X X Good use of don t cres F y z unneeded X X Unnecessry use of don t cres; results in etr term y 6 You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

Optimiztion Emple using Don t Cres Minimize: F = bc + bc + b c Given don t cres: bc, bc F bc c b X Note: Introduce don t cres with cution Must be sure tht we relly don t cre wht the function outputs for tht input combintion X F = c + b If we do cre, even the slightest, then it s probbly sfer to set the output to Digitl Design 2e Frnk Vhid 7 You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

Optimiztion with Don t Cres Emple: Sliding Switch Switch with 5 positions 3-bit vlue gives position in binry Wnt circuit tht Outputs when switch is in position 2, 3, or 4 Outputs when switch is in position or 5 Note tht the 3-bit input cn never output binry, 6, or 7 Tret s don t cre input combintions Digitl Design 2e Frnk Vhid G Without don t cres: F = y + y z 2 3 4 5 G y z 2,3,4, detector X X X y z y y z F With don t cres: F = y + z 8 You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

Automting Two-Level Logic Size Optimiztion Minimizing by hnd Is hrd for functions with 5 or more vribles My not yield minimum cover depending on order we choose Is error prone Minimiztion thus typiclly done by utomted tools Ect lgorithm: finds optiml solution Heuristic: finds good solution, but not necessrily optiml I () I (b) y z y 4 terms y Digitl Design 2e Frnk Vhid y z z y Only 3 terms 9 You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

Bsic Concepts Underlying Automted Two-Level Digitl Design 2e Frnk Vhid Logic Size Optimiztion Definitions On-set: All minterms tht define when F= Off-set: All minterms tht define when F= Implicnt: Any product term (minterm or other) tht when cuses F= On K-mp, ny legl (but not necessrily lrgest) circle Cover: Implicnt y covers minterms nd Epnding term: removing vrible (like lrger K-mp circle) y is n epnsion of F y z 4 implicnts of F Note: We use K-mps here just for intuitive illustrtion of concepts; utomted tools do not use K-mps. ' y Prime implicnt: Mimlly epnded implicnt ny epnsion would cover s not in on-set y z, nd y, bove But not or they cn be epnded 2 You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

Bsic Concepts Underlying Automted Two-Level Definitions (cont) Logic Size Optimiztion Essentil prime implicnt: The only prime implicnt tht covers prticulr minterm in function s on-set Importnce: We must include ll essentil PIs in function s cover In contrst, some, but not ll, nonessentil PIs will be included G y essentil z not essentil not essentil y z y essentil Digitl Design 2e Frnk Vhid 2 You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

Automted Two-Level Logic Size Optimiztion Method Steps nd 2 re ect Step 3: Hrd. Checking ll possibilities: ect, but computtionlly epensive. Checking some but not ll: heuristic. Digitl Design 2e Frnk Vhid 22 You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

Tbulr Method Step : Determine Prime Implicnts Methodiclly Compre All Implicnt Pirs, Try to Combine Emple function: F = 'y'z' + 'y'z + ' + y'z + ' + Minterms (3-literl implicnts) () 'y'z' () 'y'z (3) ' 'y'z'+' No 'y'z'+'y'z = 'y' 2-literl implicnts (,) 'y' (,5) y'z (,3) 'z (3,7) Actully, compring ALL pirs isn t necessry just pirs differing in uncomplemented literls by one. Minterms (3-literl implicnts) () 'y'z' () 'y'z (3) ' 2-literl implicnts (,) 'y' (,5) y'z (,3) 'z (3,7) -literl implicnts (,5,3,7) z (,3,5,7) z (5) y'z (5,7) z 2 (5) y'z (5,7) z (6) ' (6,7) y (6) ' (6,7) y (7) 3 (7) Prime implicnts: Digitl Design 2e Frnk Vhid Implicnt's number of uncomplemented literls 'y' y z 23 You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

Tbulr Method Step 2: Add Essentil PIs to Cover Prime implicnts (from Step ): 'y', y, z Prime implicnts Prime implicnts Prime implicnts Minterms 'y' (,) y (6,7) z (,3,5,7) Minterms 'y' (,) y (6,7) z (,3,5,7) Minterms 'y' (,) y (6,7) z (,3,5,7) () 'y'z' () 'y'z' () 'y'z' () 'y'z () 'y'z () 'y'z (3) ' (3) ' (3) ' (5) y'z (5) y'z (5) y'z (6) ' (6) ' (6) ' (7) (7) (7) () (b) (c) Digitl Design 2e Frnk Vhid If only one X in row, then tht PI is essentil it's the only PI tht covers tht row's minterm. 24 You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

Tbulr Method Step 3: Use Fewest Remining PIs to Cover Remining Minterms Essentil PIs (from Step 2): 'y', y, z Covered ll minterms, thus nothing to do in step 3 Finl minimized eqution: F = 'y' + y + z Minterms () 'y'z' () 'y'z (3) ' Prime implicnts 'y' (,) y (6,7) z (,3,5,7) (5) y'z (6) ' (7) (c) Digitl Design 2e Frnk Vhid 25 You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

Problem with Methods tht Enumerte ll Minterms or Compute ll Prime Implicnts Too mny minterms for functions with mny vribles Function with 32 vribles: 2 32 = 4 billion possible minterms. Too much compute time/memory Too mny computtions to generte ll prime implicnts Compring every minterm with every other minterm, for 32 vribles, is (4 billion) 2 = qudrillion computtions Functions with mny vribles could requires dys, months, yers, or more of computtion unresonble Digitl Design 2e Frnk Vhid 26 You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

Solution Solution to Computtion Problem Don t generte ll minterms or prime implicnts Insted, just tke input eqution, nd try to itertively improve it E: F = bcdefgh + bcdefgh + jklmnop Note: 5 vribles, my hve thousnds of minterms But cn minimize just by combining first two terms: F = bcdefg(h+h ) + jklmnop = bcdefg + jklmnop Digitl Design 2e Frnk Vhid 27 You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

Two-Level Optimiztion using Itertive Method Method: Rndomly pply epnd opertions, see if helps Epnd: remove vrible from term Like epnding circle size on K-mp e.g., Epnding z to z legl, but epnding z to z not legl, in shown function After epnd, remove other terms covered by newly epnded term Keep trying (iterte) until doesn t help I () I (b) y z y z z z z ' Not legl E: F = bcdefgh + bcdefgh + jklmnop F = bcdefg + bcdefgh + jklmnop F = bcdefg + jklmnop Illustrted bove on K-mp, but itertive method is intended for n utomted solution (no K-mp) Digitl Design 2e Frnk Vhid Covered by newly epnded term bcdefg 28 You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

E: Itertive Hueristic for Two-Level Logic Size Optimiztion F = + ' + 'y'z' + 'y'z (minterms in on-set) Rndom epnd: F = + ' + 'y'z + 'y'z Legl: Covers ' nd, both in on-set Any implicnt covered by y? Yes, '. F = y + ' + 'y'z' + 'y'z Rndom epnd: F = y + 'y'z' + 'y'z Not legl ( covers y'z', y'z, ', : two not in on-set) Rndom epnd: F = y + 'y'z' + 'y'z Legl X Implicnt covered by 'y': 'y'z X F = y + 'y'z' + 'y'z X X X Digitl Design 2e Frnk Vhid 29 You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

Multi-Level Logic Optimiztion Performnce/Size Trdeoffs We don t lwys need the speed of two-level logic Multiple levels my yield fewer gtes Emple F = b + cd + ce F2 = b + c(d + e) = (b + c(d + e)) Generl technique: Fctor out literls y + z = (y+z) b c d c e 4 6 6 22 trnsistors 2 gte delys 6 F = b + cd + ce () F b c d e 4 4 6 trnsistors 4 gte-delys 4 F2 = (b+c(d+e)) (b) 4 size(trnsistors) F2 2 5 5 F (c) F2 2 3 4 dely (gte-delys) Digitl Design 2e Frnk Vhid 3 You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

Multi-Level Emple Q: Use multiple levels to reduce number of trnsistors for F = bcd + bcef A: bcd + bcef = bc(d + ef) Hs fewer gte inputs, thus fewer trnsistors b c d b c e f 8 22 trnsistors 8 trnsistors 2 gte delys 3 gte delys 2 F b 6 c 4 F2 5 4 F = bcd + bcef () F d e f 4 4 F2 = bc(d + ef) (b) size (trnsistors) 5 (c) F2 2 3 4 dely (gte-delys) Digitl Design 2e Frnk Vhid 3 You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

Multi-Level Emple: Non-Criticl Pth Criticl pth: longest dely pth to output Optimiztion: reduce size of logic on non-criticl pths by using multiple levels b c d e g f 4 6 6 26 trnsistors 3 gte-delys 4 F = (+b)c + dfg + efg () 6 F b c b f g 4 4 22 trnsistors 3 gte-delys 4 6 4 F2 = (+b)c + (d+e)fg (b) F2 Size (trnsistors) 25 2 5 5 (c) F F2 2 3 4 dely (gte-delys) Digitl Design 2e Frnk Vhid 32 You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)

Automted Multi-Level Methods Min techniques use heuristic itertive methods Define vrious opertions Fctoring : bc + bd = b(c+d) Plus other trnsformtions similr to two-level itertive improvement Digitl Design 2e Frnk Vhid 33 You creted this PDF from n ppliction tht is not licensed to print to novpdf printer (http://www.novpdf.com)