Advced Digitl Logic Desig EECS 303 http://ziyg.eecs.orthwester.edu/eecs303/ Uix privcy hit Techer: Robert Dick Office: L477 Tech Emil: dickrp@orthwester.edu Phoe: 847 467 2298 chmod -R go-rwx ~ Letter Meig Letter Meig u user r red g group w write o other x execute 3 Robert Dick Advced Digitl Logic Desig is ecessry properties is sufficiet properties f,b b 0 0 0 0 f,b b 0 0 0 0 Some Boole fuctios c ot be represeted with oe logic level b b 6 Robert Dick Advced Digitl Logic Desig All Boole fuctios c be represeted with two logic levels Give k vribles, 2 K miterm fuctios exist Select rbitrry uio of miterms 7 Robert Dick Advced Digitl Logic Desig Two-level well-uderstood properties properties Two-level sometimes imprcticl As we will see lter, optiml miimiztio techiques kow for two-level However, optiml two-level solutio my ot be optiml solutio Sometimes suboptiml solutio to the right problem is better th the optiml solutio to the wrog problem cd f,b,c,d 00 0 0 00 0 0 0 b 0 0 0 0 0 0 0 Cosider 4-term XOR prity gte: b c d 8 Robert Dick Advced Digitl Logic Desig 9 Robert Dick Advced Digitl Logic Desig Two-level wekess properties Two-level wekess properties Two-level represettio is expoetil However, it s simple cocept Is i x i odd? Problem with represettio, ot fuctio Two-level represettios lso hve other wekesses Coversio from SOP to POS is difficult Ivertig fuctios is difficult -ig two SOPs or ig two POSs is difficult Neither geerl POS or SOP re coicl Equivlece checkig difficult POS stisfibility N P-complete 0 Robert Dick Advced Digitl Logic Desig Robert Dick Advced Digitl Logic Desig
properties Logic miimiztio motivtio properties Logic miimiztio motivtio Wt to reduce re, power cosumptio, dely of circuits Hrd to exctly predict circuit re from equtios C pproximte re with SOP cubes Miimize umber of cubes d literls i ech cube Algebric simplifictio difficult Hrd to gurtee optimlity K-mps work well for smll problems Too error-proe for lrge problems Do t esure optiml prime implict selectio Quie McCluskey optiml d c be ru by computer Too slow o lrge problems heuristic usully gets good results fst o lrge problems 2 Robert Dick Advced Digitl Logic Desig 3 Robert Dick Advced Digitl Logic Desig properties Review: Algebric simplifictio properties Boole fuctio miimiztio Prove XY XY = X XY XY = XY Y distributive lw XY Y = X complemetry lw X = X idetity lw Algebric simplifictio Not systemtic How do you kow whe optiml solutio hs bee reched? Optiml lgorithm, e.g., Quie McCluskey Oly fst eough for smll problems Uderstdig these is foudtio for uderstdig more dvced methods Not ecessrily optiml heuristics Fst eough to hdle lrge problems 5 Robert Dick Advced Digitl Logic Desig 6 Robert Dick Advced Digitl Logic Desig properties Quie McCluskey two-level logic miimiztio Computig prime implicts properties Compute prime implicts with well-defied lgorithm Strt from miterms Merge djcet implicts util further mergig impossible Select miiml cover from prime implicts Ute coverig problem = 0 = = 2 = 3 = 4 0000 000X 00X0 X000 000 X00 000 X00 000 00X 0X0 00 X0 00 X0 0 X 0 X X00X X0X0 8 Robert Dick Advced Digitl Logic Desig 9 Robert Dick Advced Digitl Logic Desig Defiitio: Ute coverig properties Prime implict selectio properties Give mtrix for which ll etries re 0 or, fid the miimum crdility subset of colums such tht, for every row, t lest oe colum i the subset cotis. I ll give exmple 0X 0X0 X00 X 000 00 0 00 20 Robert Dick Advced Digitl Logic Desig 2 Robert Dick Advced Digitl Logic Desig
Cyclic core properties Implict selectio reductio properties bc 00 0 0 00 0 0 0 0 00 0X 0X X0 X0 0X X0 Elimite rows covered by essetil colums Elimite rows domited by other rows Elimite colums domited by other colums 00 0 0 22 Robert Dick Advced Digitl Logic Desig 23 Robert Dick Advced Digitl Logic Desig properties Elimite rows covered by essetil colums properties Elimite rows domitig other rows A B C H I J K A B C H I J 24 Robert Dick Advced Digitl Logic Desig 25 Robert Dick Advced Digitl Logic Desig properties Elimite colums domited by other colums Bcktrckig properties A B C H I J K Will proceed to complete solutio uless cyclic If cyclic, c boud cover size Compute idepedet sets 26 Robert Dick Advced Digitl Logic Desig 27 Robert Dick Advced Digitl Logic Desig Fid lower boud properties properties Use boud to costri serch spce 0 bc 00 0 0 0 0 0X 0X X0 X0 0X X0 00 0 00 00 0 Elimite rows covered by essetil colums Elimite rows domited by other rows Elimite colums domited by other colums Brch-d-boud o cyclic problems Use idepedet sets to boud Speed improved, still N P-complete 0 3 disjoit rows 3 colums required 28 Robert Dick Advced Digitl Logic Desig 29 Robert Dick Advced Digitl Logic Desig
Extremely brief itroductio to N P-completeess Polyomil-time lgorithms: O, O lg, O 2 0000 f 2 000 lg 00 0 0 20 40 60 80 00 32 Robert Dick Advced Digitl Logic Desig Extremely brief itroductio to N P-completeess There lso exist expoetil-time lgorithms: O 2 lg, O 2, O 3 e50 e45 e40 e35 e30 f e25 3 2 e20 e5 e0 00000 2 lg, 2, lg, 0 20 40 60 80 00 33 Robert Dick Advced Digitl Logic Desig Extremely brief itroductio to N P-completeess N P-completeess Ay N P-complete problem istce c be coverted to y other N P-complete problem istce i polyomil time quickly Nobody hs ever developed polyomil time fst lgorithm tht optimlly solves N P-complete problem It is geerlly believed but ot prove tht it is ot possible to devise polyomil time fst lgorithm tht optimlly solves N P-complete problem C use heuristics Fst lgorithms tht ofte produce good solutios Recll tht sortig my be doe i O lg time DFS O V E, BFS O V, Topologicl sort O V E f 0000 000 00 0 2 lg 0 20 40 60 80 00 34 Robert Dick Advced Digitl Logic Desig 35 Robert Dick Advced Digitl Logic Desig N P-completeess N P-completeess There lso exist expoetil-time lgorithms: O 2 lg, O 2, O 3 f e50 e45 e40 e35 e30 e25 3 2 e20 e5 e0 2 lg, 2, lg, 00000 0 20 40 60 80 00 For t = 2 secods t = 2 secods t0 = 7 miutes t20 = 2 dys t50 = 35, 702, 052 yers t00 = 40, 96,936,84,33,500,000,000 yers 36 Robert Dick Advced Digitl Logic Desig 37 Robert Dick Advced Digitl Logic Desig N P-completeess N P-completeess Digitl desig d sythesis is full of NP-complete problems Grph colorig Schedulig Grph prtitioig Stisfibility d 3SAT Coverig...d my more There is clss of problems, N P-complete, for which obody hs foud polyomil time solutios It is possible to covert betwee these problems i polyomil time Thus, if it is possible to solve y problem i N P-complete i polyomil time, ll c be solved i polyomil time Uprove cojecture: N P = P 38 Robert Dick Advced Digitl Logic Desig 39 Robert Dick Advced Digitl Logic Desig
N P-completeess N P-completeess Wht is N P? Nodetermiistic polyomil time. A computer tht c simulteously follow multiple pths i solutio spce explortio tree is odetermiistic. Such computer c solve N P problems i polyomil time. I.e., computer tht c simulteously be i multiple sttes. Nobody hs bee ble to prove either or P N P P = N P If we defie N P-complete to be set of problems i N P for which y problem s istce my be coverted to istce of other problem i N P-complete i polyomil time, the P N P N P-complete P = 40 Robert Dick Advced Digitl Logic Desig 4 Robert Dick Advced Digitl Logic Desig Bsic complexity clsses How to del with hrd problems N P-complete N P P P solvble i polyomil time by computer Turig Mchie N P solvble i polyomil time by odetermiistic computer N P-complete coverted to other N P-complete problems i polyomil time Wht should you do whe you ecouter ppretly hrd problem? Is it i N P-complete? If ot, solve it If so, the wht? Despir. Solve it! Resort to suboptiml heuristic. Bd, but sometimes the oly choice. Develop pproximtio lgorithm. Better. Determie whether ll ecoutered problem istces re costried. Woderful whe it works. 42 Robert Dick Advced Digitl Logic Desig 44 Robert Dick Advced Digitl Logic Desig Oe exmple Heuristic logic miimiztio Heristic logic miimiztio O. Coudert. Exct colorig of rel-life grphs is esy. Desig Automtio, pges 2 26, Jue 997. Optiml two-level logic sythesis is N P-complete Upper boud o umber of prime implicts grows 3 / where is the umber of iputs Give > 6 iputs, c be itrctble However, there hve bee dvces i complete solvers for my fuctios Optiml solutios re possible for some lrge fuctios 45 Robert Dick Advced Digitl Logic Desig 48 Robert Dick Advced Digitl Logic Desig Heuristic logic miimiztio Heristic logic miimiztio Heristic logic miimiztio two-level logic miimiztio heuristic For difficult d lrge fuctios, solve by heuristic serch Multi-level logic miimiztio is lso best solved by serch The geerl serch problem c be itroduced vi two-level miimiztio Exmie simplified versio of the lgorithms i Geerte oly subset of prime implicts Crefully selects subset of prime implicts coverig o-set Gurteed to be correct My ot be optiml 49 Robert Dick Advced Digitl Logic Desig 50 Robert Dick Advced Digitl Logic Desig
Heristic logic miimiztio Summry Heristic logic miimiztio C be viewed i the followig Strt with potetilly optiml lgorithm Add umerous techiques for costriig the serch spce Uses efficiet move order to llow pruig Disble bcktrckig to rrive t heuristic solver Widely used i idustry Still hs room for improvemet E.g., erly recursio termitio Properties of two-level logic The Quie-McCluskey tbulr method N P-complete: Why use heuristics? 5 Robert Dick Advced Digitl Logic Desig 52 Robert Dick Advced Digitl Logic Desig ssigmet oe Next lecture Algebric mipultio Review K-Mps Review Quie-McCluskey More o lgorithm Techologies d implemettio methods 54 Robert Dick Advced Digitl Logic Desig 55 Robert Dick Advced Digitl Logic Desig Redig ssigmet http://www.writphotec.com/mo/redig supplemets.html More Optimiztio for Quie McCluskey 56 Robert Dick Advced Digitl Logic Desig