Fundmntl Algorithms for Sstm Modling, Anlsis, nd Optimiztion Edwrd A. L, Jijt Rohowdhur, Snjit A. Sshi UC Brkl EECS 144/244 Fll 2011 Copright 2010-11, E. A. L, J. Rohowdhur, S. A. Sshi, All rights rsrvd L 11: Booln Algr nd Logi Optimiztion- 2 Thnks to S. Dvds, K. Kutzr, S. Mlik, R. Rutnr for svrl slids Multi-lvl Logi Optimiztion: Outlin Ovrviw of Multi-lvl Optimiztion: An Empl Cor Conpts: Booln Funtion Domposition Booln nd Algri Division Idntifing Divisors EECS 144/244, UC Brkl: 2
Rprsnttion: Booln Ntwork Nods lld with SOP prssions + EECS 144/244, UC Brkl: 3 Booln Ntwork, Eplind It s grph: Primr inputs (vrils) Primr outputs Intrmdit nods (in SOP form in trms of its inputs) Qulit of ntwork: r, dl, msurd in trms of #(litrls), dpth, EECS 144/244, UC Brkl: 4
Th.-Indpndnt Multi-Lvl Optimiztion: Oprtions on Booln Ntwork Involvs prforming th following oprtions itrtivl until good nough rsult is otind: 1. Simplifition Minimizing two-lvl logi funtion (SOP for singl nod) 2. Elimintion Sustituting on prssion into nothr. 3. Domposition Eprssing singl SOP with 2 or mor simplr forms 4. Etrtion Finding & pulling out suprssions ommon to mn nods 5. Sustitution Lik trtion, ut nods in th ntwork r r-usd EECS 144/244, UC Brkl: 5 Empl (du to G. D Mihli) d v = d + d + d + p = + d r = p + s = r + t = + d + + d + w q = + u = q + q + q z #litrls = 33, dpth = 3 EECS 144/244, UC Brkl: 6
Empl: Elimintion d v = d + d + d + p = + d r = p + s = r + t = + d + + d + w q = + u = q + q + q z #litrls = 33, dpth = 3 EECS 144/244, UC Brkl: 7 Empl: Elimint nod r d v = d + d + d + p = + d s = p + + t = + d + + d + w q = + u = q + q + q z #litrls = 32, dpth = 2 EECS 144/244, UC Brkl: 8
Empl: Simplifition d v = d + d + d + p = + d s = p + + t = + d + + d + w q = + u = q + q + q z #litrls = 32, dpth = 2 EECS 144/244, UC Brkl: 9 Empl: Simplifing nod u d v = d + d + d + p = + d s = p + + t = + d + + d + w q = + u = q + z #litrls = 28, dpth = 2 EECS 144/244, UC Brkl: 10
Empl: Domposition d v = d + d + d + p = + d s = p + + t = + d + + d + w q = + u = q + z #litrls = 28, dpth = 2 EECS 144/244, UC Brkl: 11 Empl: Domposing nod v j = + + v = jd + w d p = + d s = p + + t = + d + + d + q = + u = q + z #litrls = 27, dpth = 2 EECS 144/244, UC Brkl: 12
Empl: Etrtion j = + + v = jd + w d p = + d s = p + + t = + d + + d + q = + u = q + z #litrls = 27, dpth = 2 EECS 144/244, UC Brkl: 13 Empl: Etrting from p nd t j = + + v = jd + w p = k s = p + + d k = + d t = k + k + q = + u = q + z #litrls = 23, dpth = 3 EECS 144/244, UC Brkl: 14
Empl: Wht nt? Cn w improv furthr? j = + + v = jd + w p = k s = p + + d k = + d t = k + k + q = + u = q + z #litrls = 23, dpth = 3 EECS 144/244, UC Brkl: 15 Whih Oprtions Do W Know How to Do? 1. Simplifition Minimizing two-lvl logi funtion (SOP for singl nod) 2. Elimintion Sustituting on prssion into nothr. 3. Domposition Eprssing singl SOP with 2 or mor simplr forms 4. Etrtion Finding & pulling out suprssions ommon to mn nods 5. Sustitution Lik trtion, ut nods in th ntwork r r-usd EECS 144/244, UC Brkl: 16
Domposition Ftoring/Division Strting with SOP Form f = + d + + d + W wnt to gnrt n quivlnt Ftord form f = ( + ) ( + d) + Rson: Ftord forms r nturl multi-lvl rprsnttions tr-lik prssions To do ftoring, w nd to Idntif divisors Prform division EECS 144/244, UC Brkl: 17 Divisors nd Domposition Givn Booln funtion F, w wnt to writ it s F = D. Q + R whr D Divisor, Q Quotint, R Rmindr Domposition: Srhing for divisors whih r ommon to mn funtions in th ntwork idntif divisors whih r ommon to svrl funtions introdu ommon divisor s nw nod r-prss isting nods using th nw divisor EECS 144/244, UC Brkl: 18
Topis Wht is division? Booln vs. Algri How to prform division How to idntif divisors EECS 144/244, UC Brkl: 19 Booln Division Givn Booln funtion F, w wnt to writ it s F = D. Q + R Dfinition: D is Booln divisor of F if Q nd R ist suh tht F = DQ + R, DQ 0. (F 0) D is sid to ftor of F if, D is divisor of F nd in ddition, R = 0; i.., F = DQ. EECS 144/244, UC Brkl: 20
Booln Division: K Rsults D is ftor of F iff F. D = 0 ON-SET(D) ontins ON-SET(F) F. D!= 0 iff D is divisor of F How mn possil ftors D n thr for givn F? EECS 144/244, UC Brkl: 21 Booln Division: Proof Ids D is ftor of F iff F. D = 0 (onl if prt): F = DQ, so F.D = 0 (if prt): Givn tht F.D = 0, F D, so F = DF, or F =D(F+X) whr X.D = 0. Thus, F = DH for som H. F. D!= 0 iff D is divisor of F (if): F = DQ + R, FD = DQ + DR, sin DQ!= 0, FD!= 0 (onl if): FD!= 0 nd F = FD + FD, tk Q=F+d, R=FD, whr dd = 0. How mn possil ftors D n thr for givn F? Doul ponntil in numr of vrils EECS 144/244, UC Brkl: 22
Algri Modl Id: Prform division using onl th ruls (ioms) of rl numrs, not ll of Booln lgr Rl Numrs. =. + = +.(.) = (.). +(+) = (+)+.(+) =. +..1 =.0 = 0 +0 = Booln Algr. =. + = +.(.) = (.). +(+) = (+)+.(+) =. +..1 =.0 = 0 +0 = +(.) = (+). (+) + = 1. = 0. = += +1 = 1 + =.(+) = EECS 144/244, UC Brkl: 23 Algri Division A litrl nd its omplmnt r trtd s unrltd Eh litrl s frsh vril E.g. f = + + s f = + d + Trt SOP prssion s polnomil Division/ftoring thn oms polnomil division/ftoring Booln idntitis r ignord o Ept in pr-prossing o Simpl lol simplifitions lik + prformd EECS 144/244, UC Brkl: 24
Algri vs. Booln ftoriztion f = + + + + + Algri ftoriztion produs f = ( + ) + ( + ) + + Booln ftoriztion produs f = ( + + )( + + ) EECS 144/244, UC Brkl: 25 Algri Division Empl F = + d + + d + Wnt to gt Q, R, whr F = D Q + R 1. D = + for 2. D = EECS 144/244, UC Brkl: 26
Algri Division Algorithm Wht w wnt: Givn F, D, find Q, R F, D prssd s sts of us (sm for Q, R) Approh: For h u C in D { lt B = {us in F ontind in C} if (B is mpt) rturn Q = { }, R = F lt B = {us in B with vrils in C rmovd} if (C is th first u in D w r looking t) lt Q = B; ls Q = Q B; } Complit? R = F \ (Q D); EECS 144/244, UC Brkl: 27 Tking Stok Wht w know: How to prform Algri division givn divisor D Wht w don t How to find divisor D? Rll wht w wntd to do: Givn 2 funtions F nd G, find ommon divisor D nd ftoriz thm s F = D Q1 + R1 G = D Q2 + R2 EECS 144/244, UC Brkl: 28
Nw Trminolog: Krnls A krnl of Booln prssion F is u-fr prssion tht rsults whn ou divid F singl u Tht singl u is lld o-krnl Cu-fr prssion: Cnnot ftor out singl u tht lvs hind no rmindr Empls: Whih r u-fr? F1 = + F2 = + d EECS 144/244, UC Brkl: 29 Krnls: Empls F = + + d + K(f) Krnl Co-krnl {,,d} {,}?? {,,d,}? Not: n viw krnls s sts of us EECS 144/244, UC Brkl: 30
Wh r Krnls Usful? Multi-lvl logi optimizr wnts to find ommon divisors of two (or mor) funtions f nd g Thorm: [Brton & MMulln] f nd g hv non-trivil (multipl-u) ommon divisor d if nd onl if thr ist krnls k f K( f ), k g K( g ) suh tht k f k g is non-trivil, i.., not u (hr st intrstion is pplid to th sts of us in k f nd k g ) n us krnls of f nd g to lot ommon divisors EECS 144/244, UC Brkl: 31 Thorm, Skthd Informll F = D1. K1 + R1 G = D2. K2 + R2 K1 = (X + Y + ) + stuff1 K2 = (X + Y + ) + stuff2 Thn, F = (X + Y + ) D1 + stuff3 G = (X + Y + ) D2 + stuff4 So, if w find krnls nd intrst thm, th intrstion givs us our ommon divisor EECS 144/244, UC Brkl: 32
Krnl Intrstion: Empl F = + + d + G = d + + d + + K(f) Krnl Co-krnl {,,d} {,} {,} {,,d,} 1 K(g) Krnl Co-krnl {,} d or {d,} or {d,,} {d,,d,,} 1 EECS 144/244, UC Brkl: 33 How do w find Krnls? Ovrviw: Givn funtion F 1. Pik vril ppring in F, nd us it s divisor 2. Find th orrsponding krnl K if on ists (t lst 2 us in F ontin ) If not, go k to (1) nd pik nothr vril 3. Us K in pl of F nd rurs to find krnls of K F = K + R nd K = M + S F = M + Add krnls of K to thos of F 4. Go k to (1) nd pik nothr vril to kp finding krnls EECS 144/244, UC Brkl: 34
Finding Krnls: Empl F = + d + d + d + d + d + d + EECS 144/244, UC Brkl: 35 Finding Krnls: Empl F = + d + d + d + d + d & d oth ontin. Intrstion is. Rurs on F/ = +d + Tk intrstion of ll us ontining vril EECS 144/244, UC Brkl: 36
Krnl Finding Algorithm FindKrnls(F) { K = { }; for (h vril in F) { if (F hs t lst 2 us ontining ) { lt S = {us in F ontining }; lt = u rsulting from intrstion of ll us in S K = K FindKrnls(F/); //rursion } } K = K F ; rturn K; } EECS 144/244, UC Brkl: 37 Strong (or Booln) Division [optionl rding] Givn funtion f to strong dividd g Add n tr input to f orrsponding to g, nml G nd otin funtion h s follows Inputs to f tht h DC = Gg+ G g nnot our h ON = f ON h DC = f ON. h DC h OFF f ON h DC Gt: h = Q G + R Minimiz h using two-lvl minimizr EECS 144/244, UC Brkl: 38
Rding R. Brton, G. Hhtl, A. Sngiovnni-Vinntlli, Multilvl Logi Snthsis, Prodings of th IEEE, F 90. EECS 144/244, UC Brkl: 39