Logi Synthesis nd Verifition SOPs nd Inompletely Speified Funtions Jie-Hong Rolnd Jing 江介宏 Deprtment of Eletril Engineering Ntionl Tiwn University Fll 2010 Reding: Logi Synthesis in Nutshell Setion 2 most of the following slides re y ourtesy of Andres Kuehlmnn 1 2 Boolen Funtion Representtion Sum of Produts A funtion n e represented y sum of ues (produts): E.g., f = + + Sine eh ue is produt of literls, this is sum of produts (SOP) representtion An SOP n e thought of s set of ues F E.g., F = {,, } A set of ues tht represents f is lled over of f E.g., F 1 ={,, } nd F 2 ={,,, } re overs of f = + +. List of Cues (Cover Mtrix) We often use mtrix nottion to represent over: Exmple F = + d = d d 1 2 1 2 or 1-1 - d 2 2 0 1 - - 0 1 Eh row represents ue 1 mens tht the positive literl ppers in the ue 0 mens tht the negtive literl ppers in the ue 2 (or -) mens tht the vrile does not pper in the ue. It impliitly represents oth 0 nd 1 vlues. 3 4
PLA A PLA is (multiple-output) funtion f : B n B m represented in SOP form n=3, m=3 over mtrix PLA Eh distint ue ppers just one in the ANDplne, nd n e shred y (multiple) outputs in the OR-plne, e.g., ue () f 1 f 2 f 3 10-1 - - -11 1 - - 0-0 - 1-111 - 1 1 00- - - 1 Extensions from single-output to multiple-output minimiztion theory re strightforwrd f 1 f 2 f 3 5 6 SOP Irredundnt Cue The over (set of SOPs) n effiiently represent mny prtil logi funtions (i.e., for mny prtil funtions, there exist smll overs) Two-level minimiztion seeks the over of minimum size (lest numer of ues) = onset minterm Note tht eh onset minterm is overed y t lest one of the ues! None of the offset minterms is overed 7 Let F = { 1, 2,, k } e over for f, i.e., f = i k =1 i A ue i F is irredundnt if F\{ i } f Exmple f = + + F\{} f Not overed 8
Prime Cue A literl x ( vrile or its negtion) of ue F (over of f) is prime if (F \ {}) { x } f, where x (oftor w.r.t. x) is with literl x of deleted A ue of F is prime if ll its literls re prime Exmple f = xy + xz + yz = xy; y = x (literl y deleted) F \ {} { y } = x + xz + yz z yz xz x Prime nd Irredundnt Cover Definition 1. A over is prime (resp. irredundnt) if ll its ues re prime (resp. irredundnt) Definition 2. A prime (ue) of f is essentil (essentil prime) if there is onset minterm (essentil vertex) in tht prime ut not in ny other prime. Definition 3. Two ues re orthogonl if they do not hve ny minterm in ommon E.g. 1 = x y 2 = y z re orthogonl 1 = x y 2 = y z re not orthogonl inequivlent to f sine offset vertex is overed x y 9 10 Prime nd Irredundnt Cover Exmple f = + d + d is prime nd irredundnt. is essentil sine d, ut not in d or d or d Why is d not n essentil vertex of? Wht is n essentil vertex of? Wht other ue is essentil? Wht prime is not essentil? d d d Inompletely Speified Funtion Let F = (f, d, r) : B n {0, 1, *}, where * represents don t re. f = onset funtion f(x)=1 F(x)=1 r = offset funtion r(x)=1 F(x)=0 d = don t re funtion d(x)=1 F(x)=* (f,d,r) forms prtition of B n, i.e, f + d + r = B n (f d) = (f r) = (d r) = (pirwise disjoint) (Here we don t distinguish hrteristi funtions nd the sets they represent) 11 12
Inompletely Speified Funtion A ompletely speified funtion g is over for F = (f,d,r) if f g f+d g r = if x d (i.e. d(x)=1), then g(x) n e 0 or 1; if x f, then g(x) = 1; if x r, then g(x) = 0 We don t re whih vlue g hs t x d Prime of Inompletely Speified Funtion Definition. A ue is prime of F = (f,d,r) if f+d (n implint of f+d), nd no other implint (of f+d) ontins (i.e., it is simply prime of f+d) Definition. Cue j of over G = { i } of F = (f,d,r) is redundnt if f G\{ j }; otherwise it is irredundnt Note tht f+d r = 13 14 Prime of Inompletely Speified Funtion Exmple Consider logi minimiztion of F(,,)=(f,d,r) with f= + + nd d = + on off don t re F 1 ={,, } Expnd F 2 ={,, } is redundnt is prime F 3 = {, } Expnd Cheking of Prime nd Irredundny Let G e over of F = (f,d,r). Let D e over for d i G is redundnt iff i (G\{ i }) D (1) (Let G i G\{ i } D. Sine i G i nd f G f+d, then i i f+ i dnd i f G\{ i }. Thus f G\{ i }.) A literl l i is prime if ( i \{ l }) ( = ( i ) l ) is not n implint of F A ue i is prime of F iff ll literls l i re prime Literl l i is not prime ( i ) l f+d (2) Note: Both tests (1) nd (2) n e heked y tutology (to e explined): (G i ) i 1 (implies i redundnt) (f d) (i)l 1 (implies l not prime) The ove two oftors re with respet to ues insted of literls F 4 = {, } 15 16
(Literl) Coftor Let f : B n B e Boolen funtion, nd x= (x 1, x 2,, x n ) the vriles in the support of f; the oftor f of f y literl = x i or = x i is f xi (x 1, x 2,, x n ) = f (x 1,, x i-1, 1, x i+1,, x n ) f xi (x 1, x 2,, x n ) = f (x 1,, x i-1, 0, x i+1,, x n ) The omputtion of the oftor is fundmentl opertion in Boolen resoning! Exmple f = + f = 17 (Literl) Coftor The oftor Cx j of ue C (representing some Boolen funtion) with respet to literl x j is C if x j nd x j do not pper in C C\{x j } if x j ppers positively in C, i.e., x j C if x j ppers negtively in C, i.e., x j C Exmple C = x 1 x 4 x 6, Cx 2 = C (x 2 nd x 2 do not pper in C ) Cx 1 = x 4 x 6 (x 1 ppers positively in C) Cx 4 = (x 4 ppers negtively in C) 18 (Literl) Coftor Exmple F = + d + d F = + d (Just drop everywhere nd throw wy ues ontining literl ) Coftor nd disjuntion ommute! Shnnon Expnsion Let f : B n B Shnnon Expnsion: f = x i f xi + x i f xi Theorem: F is over of f. Then F = x i F xi + x i F xi We sy tht f nd F re expnded out x i, nd x i is lled the splitting vrile 19 20
Shnnon Expnsion Exmple F = + + F = F + F = (++)+ () = +++ Cue got split into two ues (Cue) Coftor The oftor f C of f y ue C is f with the fixed vlues indited y the literls of C E.g., if C = x i x j, then x i = 1 nd x j = 0 For C = x 1 x 4 x 6, f C is just the funtion f restrited to the suspe where x 1 = x 6 = 1 nd x 4 = 0 Note tht f C does not depend on x 1,x 4 or x 6 nymore (However, we still onsider f C s funtion of ll n vriles, it just hppens to e independent of x 1,x 4 nd x 6 ) x 1 f f x1 E.g., for f = +, f = f = nd f = 21 22 (Cue) Coftor The oftor of the over F of some funtion f is the sum of the oftors of eh of the ues of F If F={ 1, 2,, k } is over of f, then F = {( 1 ), ( 2 ),, ( k ) } is over of f Continment vs. Tutology A fundmentl theorem tht onnets funtionl ontinment nd tutology: Theorem. Let e ue nd f funtion. Then f f 1. Proof. We use the ft tht xf x = xf, nd f x is independent of x. ( ) Suppose f 1. Then f = f =. Thus, f. ( ) Suppose f. Then f+=f. In ddition, (f+) = f +1=1. Thus, f =1. f 23 24
Cheking of Prime nd Irredundny (Revisited) Let G e over of F = (f,d,r). Let D e over for d i G is redundnt iff i (G\{ i }) D (1) (Let G i G\{ i } D. Sine i G i nd f G f+d, then i i f+ i dnd i f G\{ i }. Thus f G\{ i }.) A literl l i is prime if ( i \{ l }) ( = ( i ) l ) is not n implint of F A ue i is prime of F iff ll literls l i re prime Literl l i is not prime ( i ) l f+d (2) Note: Both tests (1) nd (2) n e heked y tutology (explined): (G i ) i 1 (implies i redundnt) (f d) (i)l 1 (implies l not prime) The ove two oftors re with respet to ues insted of literls Generlized Coftor Definition. Let f, g e ompletely speified funtions. The generlized oftor of f with respet to g is the inompletely speified funtion: o( f,g) ( f g,g, f g) Definition. Let = (f, d, r) nd g e given. Then o(,g) ( f g,d g,r g) 25 26 Shnnon vs. Generlized Coftor Shnnon vs. Generlized Coftor Let g = x i. Shnnon oftor is f xi (x 1, x 2,, x n ) = f (x 1,, x i-1, 1, x i+1,, x n ) Generlized oftor with respet to g=x i is Note tht o( f, x i ) ( f x i, x i, f x i ) f on off Don t t re f x i f xi f x i x i f x i In ft f xi is the unique over of o(f, x i ) independent of the vrile x i. o( f,) ( f,, f ) f 27 28
Shnnon vs. Generlized Coftor Shnnon vs. Generlized Coftor o( f,) ( f,, f ) Shnnon Coftor Generlized Coftor f So f f f f f f x f x x f x f f x y f xy f g y f y g y f x f x f g o( f,g) g o( f,g) o(o( f, g),h) o( f,gh) o( f g,h) o( f,h) o(g,h) o( f,g) o( f,g) We will get k to the use of generlized oftor lter 29 30 Dt Struture for SOP Mnipultion most of the following slides re y ourtesy of Andres Kuehlmnn Opertion on Cue Lists AND opertion: tke two lists of ues ompute pir-wise AND etween individul ues nd put result on new list represent ues in omputer words implement set opertions s it-vetor opertions Algorithm AND(List_of_Cues C1,List_of_Cues C2) { C = foreh 1 C1 { foreh 2 C2 { = 1 2 C = C } } return C } 31 32