Lecture 11 Binary Decision Diagrams (BDDs)

Similar documents
CIT 596 Theory of Computation 1. Graphs and Digraphs

Boolean Algebra cont. The digital abstraction

Unit 4. Combinational Circuits

I 3 2 = I I 4 = 2A

Solutions for HW9. Bipartite: put the red vertices in V 1 and the black in V 2. Not bipartite!

Mid-Term Examination - Spring 2014 Mathematical Programming with Applications to Economics Total Score: 45; Time: 3 hours

CS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS

Data Structures LECTURE 10. Huffman coding. Example. Coding: problem definition

Lecture 6: Coding theory

CARLETON UNIVERSITY. 1.0 Problems and Most Solutions, Sect B, 2005

CS 491G Combinatorial Optimization Lecture Notes

Computing all-terminal reliability of stochastic networks with Binary Decision Diagrams

Solutions - Homework 1 (Due date: September 9:30 am) Presentation and clarity are very important!

Overview of Today s Lecture:

(Lec 4) Binary Decision Diagrams: Manipulation

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-2700: Digital Logic Design Fall Notes - Unit 1

2.4 Theoretical Foundations

Counting Paths Between Vertices. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs

Graph Theory. Simple Graph G = (V, E). V={a,b,c,d,e,f,g,h,k} E={(a,b),(a,g),( a,h),(a,k),(b,c),(b,k),...,(h,k)}

Nondeterministic Finite Automata

Hardware Verification 2IMF20

CS 2204 DIGITAL LOGIC & STATE MACHINE DESIGN SPRING 2014

Discrete Structures, Test 2 Monday, March 28, 2016 SOLUTIONS, VERSION α

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-378: Computer Hardware Design Winter Notes - Unit 1

CS311 Computational Structures Regular Languages and Regular Grammars. Lecture 6

Lecture 3. XML Into RDBMS. XML and Databases. Memory Representations. Memory Representations. Traversals and Pre/Post-Encoding. Memory Representations

Propositional models. Historical models of computation. Application: binary addition. Boolean functions. Implementation using switches.

18.06 Problem Set 4 Due Wednesday, Oct. 11, 2006 at 4:00 p.m. in 2-106

Logic, Set Theory and Computability [M. Coppenbarger]

Implication Graphs and Logic Testing

1. Logic verification

Engr354: Digital Logic Circuits

Introduction to Electrical & Electronic Engineering ENGG1203

Digital Circuit Engineering

Digital Circuit Engineering

where the box contains a finite number of gates from the given collection. Examples of gates that are commonly used are the following: a b

Now we must transform the original model so we can use the new parameters. = S max. Recruits

A Short Introduction to Self-similar Groups

Answers and Solutions to (Some Even Numbered) Suggested Exercises in Chapter 11 of Grimaldi s Discrete and Combinatorial Mathematics

1 PYTHAGORAS THEOREM 1. Given a right angled triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides.

Metodologie di progetto HW Technology Mapping. Last update: 19/03/09

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER MACHINES AND THEIR LANGUAGES ANSWERS

Instructions. An 8.5 x 11 Cheat Sheet may also be used as an aid for this test. MUST be original handwriting.

Exam Review. John Knight Electronics Department, Carleton University March 2, 2009 ELEC 2607 A MIDTERM

Fachgebiet Rechnersysteme1. 1. Boolean Algebra. 1. Boolean Algebra. Verification Technology. Content. 1.1 Boolean algebra basics (recap)

Factorising FACTORISING.

CSE 332. Sorting. Data Abstractions. CSE 332: Data Abstractions. QuickSort Cutoff 1. Where We Are 2. Bounding The MAXIMUM Problem 4

Lecture 2: Cayley Graphs

DeMorgan s Theorem. The dual DeMorgan D + E = D E D+E D E 1 D NOR D E. Slide 29 Modified; January 3, 2006 John Knight Digital Circuits p.

NON-DETERMINISTIC FSA

CS12N: The Coming Revolution in Computer Architecture Laboratory 2 Preparation

1 nonlinear.mcd Find solution root to nonlinear algebraic equation f(x)=0. Instructor: Nam Sun Wang

Boolean algebra.

Logic Synthesis and Verification

Lecture 6. Notes. Notes. Notes. Representations Z A B and A B R. BTE Electronics Fundamentals August Bern University of Applied Sciences

Convert the NFA into DFA

Proportions: A ratio is the quotient of two numbers. For example, 2 3

On the Spectra of Bipartite Directed Subgraphs of K 4

Lecture 8: Abstract Algebra

I1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3

Automata and Regular Languages

XML and Databases. Outline. 1. Top-Down Evaluation of Simple Paths. 1. Top-Down Evaluation of Simple Paths. 1. Top-Down Evaluation of Simple Paths

378 Relations Solutions for Chapter 16. Section 16.1 Exercises. 3. Let A = {0,1,2,3,4,5}. Write out the relation R that expresses on A.

Section 2.3. Matrix Inverses

Bi-decomposition of large Boolean functions using blocking edge graphs

Minimal DFA. minimal DFA for L starting from any other

Logic Synthesis and Verification

EE 108A Lecture 2 (c) W. J. Dally and P. Levis 2

Figure 1. The left-handed and right-handed trefoils

XML and Databases. Exam Preperation Discuss Answers to last year s exam. Sebastian Maneth NICTA and UNSW

Combinational Logic. Precedence. Quick Quiz 25/9/12. Schematics à Boolean Expression. 3 Representations of Logic Functions. Dr. Hayden So.

Control with binary code. William Sandqvist

Surds and Indices. Surds and Indices. Curriculum Ready ACMNA: 233,

Boolean Algebra. Boolean Algebra

SIMPLE NONLINEAR GRAPHS

Particle Physics. Michaelmas Term 2011 Prof Mark Thomson. Handout 3 : Interaction by Particle Exchange and QED. Recap

Welcome. Balanced search trees. Balanced Search Trees. Inge Li Gørtz

Project 6: Minigoals Towards Simplifying and Rewriting Expressions

m2 m3 m1 (a) (b) (c) n2 n3

Linear Algebra Introduction

Solids of Revolution

Determinants. x 1 y 2 z 3 + x 2 y 3 z 1 + x 3 y 1 z 2 x 1 y 3 z 2 + x 2 y 1 z 3 + x 3 y 2 z 1 = 0,

Necessary and sucient conditions for some two. Abstract. Further we show that the necessary conditions for the existence of an OD(44 s 1 s 2 )

x dx does exist, what does the answer look like? What does the answer to

Digital Circuit Engineering

IST 4 Information and Logic

LESSON 11: TRIANGLE FORMULAE

CS 275 Automata and Formal Language Theory

Jim Lambers MAT 169 Fall Semester Lecture 4 Notes

CS 573 Automata Theory and Formal Languages

CM10196 Topic 4: Functions and Relations

CSE : Exam 3-ANSWERS, Spring 2011 Time: 50 minutes

Polynomials. Polynomials. Curriculum Ready ACMNA:

MAT 403 NOTES 4. f + f =

Synthesis of Hazard-Free Multilevel Logic Under Multiple-Input Changes from Binary Decision Diagrams

ERT 316: REACTION ENGINEERING CHAPTER 3 RATE LAWS & STOICHIOMETRY

A Rewrite Approach for Pattern Containment

Outline Data Structures and Algorithms. Data compression. Data compression. Lossy vs. Lossless. Data Compression

expression simply by forming an OR of the ANDs of all input variables for which the output is

22: Union Find. CS 473u - Algorithms - Spring April 14, We want to maintain a collection of sets, under the operations of:

Transcription:

C 474A/57A Computer-Aie Logi Design Leture Binry Deision Digrms (BDDs) C 474/575 Susn Lyseky o 3 Boolen Logi untions Representtions untion n e represente in ierent wys ruth tle, eqution, K-mp, iruit, et Some representtions not unique (not nonil) qution : (,) = + qution 2: (,) = Ciruit ruth tle he untion Ciruit 2 C 474/575 Susn Lyseky 2o 3 Why BDDs An iient Representtion Synthesis, optimiztion, veriition, n testing lgorithms/tools mnipulte lrge Boolen untions Importnt to hve eiient wy to represent these untions Binry Deision Digrms (BDDs) hve emerge s populr hoie or representing these untions BDDs Grph representtion similr to inry tree (i.e. eision trees rom previous letures) Ale to eiiently represent lrge untions Some representtions re nonil (unique) C 474/575 Susn Lyseky 3o 3

Mux Representtion o Boolen untions iruit to implement logi untion S x S x S(x,, ) X3 () X3 () X3 () X3 () () () () () X () X () X () X () S(,, ) = S(,, ) = S(,, ) = S(,, ) = C 474/575 Susn Lyseky 4o 3 Mux Representtion o Boolen untions Reltion to BDDs Corresponing BDD to implement untion S One-to-one orresponene to the gtes in the lippe iruit x S S(x,, ) S(x,, ) x x x S(x,, ) Sme iruit, just lippe C 474/575 Susn Lyseky Corresponing BDD 5o 3 Binry Deision Digrm (BDD) xmple How oes it work? Line with ule represent vlue = Lines without ule represent vlue = S(x,, ) x x S S(,, ) S(,, ) S(,, ) S(,, ) x x x x C 474/575 Susn Lyseky 6o 3 2

Binry Deision Digrm (BDD) ge Nottions Severl wys to represent vlue = n vlue = Bule vs. Non-ule line Dshe vs. Soli line (then) vs. (else) lels We will opt vs. lels onsistent with most o the ook (Hthel) exmples S(x,, ) S(x,, ) S(x,, ) x x x C 474/575 Susn Lyseky 7o 3 Binry Deision Digrm (BDD) xmple 2 Let s onsier nother untion (,,,) = + + Wht is the vlue o (,,,)? Wht is the vlue o (,,,)? Notie tht i = n =, the untion oes not epen on vlue or. C 474/575 Susn Lyseky 8o 3 Orere Binry Deision Digrm (OBDD) Wht is OBDD? Orere inry eision igrms ensure the vriles pper in the sme orer long ll pths rom the root to the leves Orering : Not orere C 474/575 Susn Lyseky 9o 3 3

Orere Binry Deision Digrm (OBDD) Dierent Orering Le to Dierent Complexity xmple Vrile orering importnt, my result in more omplex (or simple) BDD All three BDDs elow represent the sme untion hir orering ( ) optiml euse there is extly one noe or eh vrile Orer : Orer : Orer : C 474/575 Susn Lyseky o 3 Orere Binry Deision Digrm (OBDD) Dierent Orering Le to Dierent Complexity xmple 2 Consier = + + e, gin oth BDDs represent sme untion Vrile orer hs lrge impt on resulting BDD, irst vrile orering ( e ) yiels muh simpler BDD e e e e e Orer : e Orer : e C 474/575 Susn Lyseky o 3 BDDs or Bsi Logi untions NO AND OR XOR NAND C 474/575 Susn Lyseky 2 o 3 4

orml Deinition o BDDs A BDD is iret yli grph (DAG) representing multiple-output swithing untion Noes re prtitione into three susets untion noe Represents the untion symol () Inegree = Outegree = Internl noe Represents vrile in untion (,,, ) Inegree Outegree = 2 untion noe Internl noes erminl noes erminl noe Represents vlue ( or ) Inegree Outegree = C 474/575 Susn Lyseky 3 o 3 orml Deinition o BDDs A BDD einition (ont ) hree types o eges Inoming ege ege rom the untion noe n eines untion rom n internl noe n represents when the orresponing vrile is ege rom n internl noe n represents when the orresponing vrile is Inoming ege ege ege C 474/575 Susn Lyseky 4 o 3 orml Deinition o BDDs A BDD einition (ont ) he untion represente y BDD is eine s ollows he untion o the terminl noe is onstnt vlue ( or ) he untion o ege is the untion o the he noe he untion o ege is the omplement o the untion o the noe he untion o noe v is given y v + v, when is the untion o the ege n is the untion o the ege he untion o the untion noe is the untion o it s outgoing ege untion o the untion noe is the untion o it s outgoing ege untion o this ege is untion o this ege is untion o this terminl noe is untion o this terminl noe is C 474/575 Susn Lyseky 5 o 3 5

BDD Cnonil orm BDDs re nonil (unique) or representtion o given vrile orering i All internl noes re esennts o some noe here re no isomorphi sugrphs or every noe Isomorphi sugrphs Isomorphi wo grphs re isomorphi i there is one-to-one orresponene etween their verties n there is n ege etween two verties o one grph i n only i there is n ege etween the two orresponing verties in the other grph nglish sme sugrph - ll verties the sme, ll eges etween verties the sme C 474/575 Susn Lyseky 6 o 3 Builing BDDs or untion How o I uil BDD given untion? Reursive use o Shnnon s xpnsion heorem = + We n keep pplying expnsion theorem, eventully we reh the unique nonil orm, whih uses only minterms = + + = ( ) + (+ ) = (+ ) = ( ) lso lle the otor o w.r.t. (with respet to) = + + = + = ( + ) + ( ) = + + = + = ( + ) + ( + ) expne w.r.t to expne w.r.t to C 474/575 Susn Lyseky 7 o 3 Builing BDDs - xerise Buil BDD or = + + + Use the vrile orering prtil expnsion with respet to Compute otors o with respet to (irst vrile in orering) = + + + = + = + C 474/575 Susn Lyseky 8 o 3 6

Builing BDDs - xerise Buil BDD or = + + + Use the vrile orering Compute otors o n with respet to (seon vrile in orering) prtil expnsion with respet to = + ( ) = = ( ) = = = + ( ) = = ( ) = = C 474/575 Susn Lyseky 9 o 3 Builing BDDs - xerise Buil BDD or = + + + Use the vrile orering Compute otors o,,, with respet to (thir vrile in orering) = = = = = = = = = = = = C 474/575 Susn Lyseky expnsion with respet to, inl BDD 2 o 3 Builing BDDs - xerise = + + + Does it work? C 474/575 Susn Lyseky 2 o 3 7

Builing BDDs - xerise 2 Buil BDD or = + + Use the vrile orering prtil expnsion with respet to Compute otors o with respet to (irst vrile in orering) = + + = + = + C 474/575 Susn Lyseky 22 o 3 Builing BDDs - xerise 2 Buil BDD or = + + Use the vrile orering Compute otors o n with respet to (seon vrile in orering) = + = + = = = = prtil expnsion with respet to equivlent otors, we n rete single noe (reue) C 474/575 Susn Lyseky = = 23 o 3 Builing BDDs - xerise 2 Buil BDD or = + + Use the vrile orering prtil expnsion with respet to Compute otors o,, n with respet to (thir vrile in orering) = = = = = = = = = = = C 474/575 Susn Lyseky 24 o 3 8

Builing BDDs - xerise 2 Buil BDD or = + + Use the vrile orering Compute otors o with respet to (ourth vrile in orering) = = expnsion with respet to, inl BDD = C 474/575 Susn Lyseky 25 o 3 Builing BDDs - xerise 2 Buil BDD or = + + Does it work? C 474/575 Susn Lyseky 26 o 3 BDD to Boolen untion xerise Cn we go rom BDD to Boolen untion? Sum ll pths rom untion noe to terminl noes = + = () + () = + = + + = + = ( + ) + () = + + = + = () + () = + = = C 474/575 Susn Lyseky 27 o 3 9

BDD to Boolen untion xerise 2 Another xmple = + + = + = ( ) + () = + = + = ( + ) + () = + + = C 474/575 Susn Lyseky 28 o 3 Reuing BDDs When uiling BDDs, result not lwys reue (xmple - slie 9) We hve isomorphi sugrphs, potentil or reution rnsorm non-reue BDD into reue BDD y itertively pplying Ientiy isomorphi sugrphs Remove reunnt noes A orere reue BDD (ROBDD) is unique so we hve nonil orm isomorphi sugrphs = (reunnt noe) C 474/575 Susn Lyseky 29 o 3 Reuing BDDs xmple 2 Let s try to reue n OBDD Itertive pply Ientiy isomorphi sugrphs Remove reunnt noes isomorphi sugrphs = (reunnt noe) C 474/575 Susn Lyseky 3 o 3

Summry, n then some Binry Deision Digrms (BDDs) iient mehnism to representtion o Boolen untions in terms o memory n CPU rnslting untion BDD n BDD untion Importne o vrile orering Metho to reue OBDDs, getting ROBDD We si tht BDDs n e eiiently store n mnipulte HOW? Reer to hnwritten notes Supplementl mterils tthe C 474/575 Susn Lyseky 3 o 3 I Opertor wo rgument opertors expresse in terms o I le Nme xpression quivlent orm AND(, G) G I(, G, ) > G G I(, G, ) < G G I(,, G) G G G XOR(, G) G I(, G, G) OR(, G) + G I(,, G) NOR(, G) ( + G) I(,, G ) XNOR(, G) ( G) I(, G, G ) NO(G) G I(G,, ) G + G I(,, G ) NO() I(,, ) G + G I(, G, ) NAND(, G) (G) I(, G, ) C 474/575 Susn Lyseky 32 o 3 I Algorithm Most stnr mnipultion o BDDs n e one with I Algorithm reursive, se on ormultion where v is the top vrile o, G, H I(, G, H) = G + H = v(g + H) v + v (G + H) v = v( v G v + v H v ) + v ( v G v + v H v ) = I( v, I( v, G v, H v ), I( v, G v, H v ) ) erminl ses re s ollows I(,, G) = I(, G, ) = I(,, ) = I(G,, ) = C 474/575 Susn Lyseky 33 o 3

Pseuo-oe o the I Algorithm I(, G, H){ (result, terminl_se) = RMINAL_CAS(, G, H) i (terminl_se) return (result) // i we in terminl se? (result, in_ompute_tle) = COMPUD_ABL_HAS_NRY(, G, H) i (in_ompute_tle) return (result) // hve we lrey lulte this vlue? } v = OP_VARIABL(, G, H) = I( v, G v, H v) = I( v, G v, H v ) R = IND_OR_ADD_UNIQU_ABL(v,, ) INSR_COMPUD_ABL((, G, H), R) return (R) // reursively lulte this vlue // see i sutree lrey present // reor the lulte vlue C 474/575 Susn Lyseky 34 o 3 2