CS137: Today Electronic Design Automation • Two-Level Logic Optimization – Problem – Definitions Day 4: October 5, 2005 – Basic Algorithm: Quine-McClusky Two-Level Logic-Synthesis – Improvements 1 2 CALTECH CS137 Fall2005 -- DeHon CALTECH CS137 Fall2005 -- DeHon Problem EDA Use • Given : Expression in combinational • Minimum size PLA, PAL, … logic – Programmable Logic Array • Find : Minimum (cost) sum-of-products – Programmable Array Logic expression • Minimum number of gates for two-level implementation • Ex. – Y=a*b*c + a*b*/c + a*/b*c • Starting point for multi-level optimization – Y=a*b + a*c 3 4 CALTECH CS137 Fall2005 -- DeHon CALTECH CS137 Fall2005 -- DeHon PLA • Directly implement flat (two-level) logic Programmable Array Logic – O=a*b*c*d + !a*b*!d + b*!c*d (PLAs) • Exploit substrate properties allow wired- OR 5 6 CALTECH CS137 Fall2005 -- DeHon CALTECH CS137 Fall2005 -- DeHon 1
Wired- or Wired- or • Connect series of inputs to wire • Obvious Implementation with Transistors • Any of the inputs can drive the wire high 7 8 CALTECH CS137 Fall2005 -- DeHon CALTECH CS137 Fall2005 -- DeHon Programmable Wired- or Programmable Wired- or • Gate-memory model • Use some memory function to programmable connect (disconnect) wires to OR • Fuse: 9 10 CALTECH CS137 Fall2005 -- DeHon CALTECH CS137 Fall2005 -- DeHon Diagram Wired- or Wired- or array • Build into array – Compute many different or functions from set of inputs 11 12 CALTECH CS137 Fall2005 -- DeHon CALTECH CS137 Fall2005 -- DeHon 2
Combined or -arrays to PLA PLA • Combine two or ( nor ) arrays to produce • Can implement each and on single line PLA ( or-and / and - or array) in first array • Can implement each or on single line in second array Strictly speaking: or in first term and in second, but with both polarities of inputs, can invert so is and-or . 13 14 CALTECH CS137 Fall2005 -- DeHon CALTECH CS137 Fall2005 -- DeHon PLA and PAL Nanowire PLA PAL = Programmable Array Logic PAL has fixed AND plane. 15 16 CALTECH CS137 Fall2005 -- DeHon CALTECH CS137 Fall2005 -- DeHon EDA Use for 2-level Logic Min. • Minimum size PAL, PLA, … …back to optimization… – Programmable Logic Array – Programmable Array Logic • Minimum number of gates for two-level implementation • Starting point for multi-level optimization 17 18 CALTECH CS137 Fall2005 -- DeHon CALTECH CS137 Fall2005 -- DeHon 3
Complexity Cost • Set covering problem • PLA/PAL - first order – number of product terms – NP-hard • Abstract (mis, sis) – {multilevel,sequential} interactive synthesis – number of literals • cost(y=a*b+a*/c )=4 • General (simple, multi-level) – ∑ cost(product-term) • e.g. nand2=4, nand3=5,nand4=6… 19 20 CALTECH CS137 Fall2005 -- DeHon CALTECH CS137 Fall2005 -- DeHon Terminology (1) Terminology (2) • Literals -- a, /a, b, /b, …. • Cube: – Qualified, single inputs – product covering one or more minterms • Minterms -- – Y=a*b+a*c – cubes: – full set of literals covering one input case • a*b*c abc – in y=a*b+a*c • a*b ab • a*b*c • a*c ac • a*/b*c 21 22 CALTECH CS137 Fall2005 -- DeHon CALTECH CS137 Fall2005 -- DeHon Terminology (3) Truth Table • Cover: • Also represent function – set of cubes Specify on-set only a b c y – sum products 0 0 0 0 a b c y – {abc, a/bc, ab/c} 0 0 1 0 1 0 1 1 0 1 0 0 – {ab,ac} 1 1 0 1 0 1 1 0 1 1 1 1 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 1 23 24 CALTECH CS137 Fall2005 -- DeHon CALTECH CS137 Fall2005 -- DeHon 4
Cube/Logic Specification In General • Canonical order for variables • Three sets: – on-set (must be set to one by cover) • Use {0,1,-} to indicate input appearance – off-set (must be set to zero by cover) in cube – don’t care set (can be zero or one) • 0 ≡ inverted abc 111 • Don’t Cares • 1 ≡ not inverted a/bc 101 – allow freedom in covering (reduce cost) • - ≡ not present ac 1-1 – arise from cases where value doesn’t matter a b c y • e.g. outputs in non-existent FSM state 1 0 1 1 1 0 1 1 • data bus value when not driving bus 1 - 1 1 1 - 1 1 1 0 1 1 1 0 1 1 1 - 1 1 1 - 1 1 1 1 1 1 1 1 25 26 CALTECH CS137 Fall2005 -- DeHon CALTECH CS137 Fall2005 -- DeHon Multiple Outputs Multiple Outputs Truth Table: Convert to On-set single-output • Can reduce to single output case a b y x for result problem 0 0 1 1 – write equations on inputs and each output 0 1 0 0 a b y x o 001- • with onset for relation being true 1 0 0 0 0 0 1 - 1 00-1 – after cover 1 1 0 1 0 0 - 1 1 010 - • remove literals associated with outputs 0 1 0 - 1 01- 0 0 1 - 0 1 100 - 1 0 0 - 1 10- 0 1 0 - 0 1 110 - 1 1 0 - 1 11- 1 1 1 - 1 1 27 28 CALTECH CS137 Fall2005 -- DeHon CALTECH CS137 Fall2005 -- DeHon Multiple Outputs Multiple Outputs 000 10 000 10 • Could Optimize separately • Consider: 001 11 -01 11 • By optimizing together – X=/a/b+ab+ac 010 00 01- 00 011 00 – Y=/bc – Maximize sharing of cubes/product-terms 100 00 100 00 • Trivial solution 101 11 has 4 product 110 10 11- 10 111 10 terms 29 30 CALTECH CS137 Fall2005 -- DeHon CALTECH CS137 Fall2005 -- DeHon 5
Multiple Outputs Prime Implicants 000 10 000 10 • Consider: • Implicant -- cube in on-set 001 11 -01 11 – X=/a/b+ab+ac – (not entirely in don’t-case set) 010 00 01- 00 – Y=/bc • Prime Implicant -- implicant, not 011 00 100 00 100 00 • Now read off contained in any other cube 101 11 cover: – for y=a*b+a*c 110 10 11- 10 – Y=/bc • a*b is a prime implicant 111 10 • a*b*c is not a prime implicant (contained in ab, – A=/a/b/c+/bc+ab ac) =/a/b+/bc+ab – I.e. largest cube still in on-set (on+dc-sets) Only need 3 product terms (versus 4 w/ no sharing) 31 32 CALTECH CS137 Fall2005 -- DeHon CALTECH CS137 Fall2005 -- DeHon Prime Implicants Restate Goal • Minimum cover will be made up of primes – less products if cover more • Goal in terms of PIs – less literals in prime than contained cubes • Necessary but not sufficient that minimum – Find minimum size set of PIs which cover cover contain only primes the on-set. – y=ab+ac+b/c – y=ac+b/c • Number of PI’s can be exponential in input size – more than minterms, even! – Not all PI’s will be in optimum cover 33 34 CALTECH CS137 Fall2005 -- DeHon CALTECH CS137 Fall2005 -- DeHon Essential Prime Implicants Computing Primes • Start with minterms • Prime Implicant which contains a – for on-set and dc-set minterm not covered by any other PI • merge pairs (distance one apart) – Essential PI must occur in any cover • for each pair merged, – y=ab+ac+b/c – mark source cubes as covered – ab 11- 110 111 • repeat merging for resulting cube set * essential (only 101) – until no more merging possible – ac 1-1 101 111 • retain all unmarked cubes which aren’t – b/c -10 110 010 * essential (only 010) entirely in dc-set 35 36 CALTECH CS137 Fall2005 -- DeHon CALTECH CS137 Fall2005 -- DeHon 6
Compute Prime Example Compute Prime Example 0, 8 -000 0 0000 0 0000 5, 7 01-1 5 0101 5 0101 7,15 -111 7 0111 7 0111 8, 9 100- 8 1000 8 1000 8,10 10-0 9 1001 9 1001 9,11 10-1 10 1010 10 1010 10,11 101- 11 1011 11 1011 10,14 1-10 14 1110 14 1110 11,15 1-11 15 1111 15 1111 14,15 111- 37 38 CALTECH CS137 Fall2005 -- DeHon CALTECH CS137 Fall2005 -- DeHon Compute Prime Example Covering Matrix • Minterms × Prime Implicants /b/c/d 0 0000 0, 8 -000 0, 8 -000 /abd Goal: 5 0101 5, 7 01-1 5, 7 01-1 bcd minimum /b/c/d /abd bcd a/b ac 7 0111 7,15 -111 7,15 -111 a/b 0000 X 8 1000 8, 9 100- 8, 9 100- cover ac 0101 X 9 1001 8,10 10-0 8,10 10-0 8, 9,10,11 10-- 0111 X X 10 1010 9,11 10-1 9,11 10-1 1000 X X 11 1011 10,11 101- 10,11 101- 10,11,14,15 1-1- 1001 X 14 1110 10,14 1-10 10,14 1-10 1010 X X 15 1111 11,15 1-11 11,15 1-11 1011 X X 14,15 111- 14,15 111- 1110 X 1111 X X 39 40 CALTECH CS137 Fall2005 -- DeHon CALTECH CS137 Fall2005 -- DeHon Essential Reduction Essential Reduction • Must pick essential PI • This case: – pick and eliminate row and column – Cover determined by essentials /b/c/d /abd bcd a/b ac 0000 X • General case: 0101 X 0111 X X – Reduces size of problem 1000 X X – These are easy… 1001 X 1010 X X 1011 X X 1110 X 41 42 1111 X X CALTECH CS137 Fall2005 -- DeHon CALTECH CS137 Fall2005 -- DeHon 7
Recommend
More recommend