Matriklinumber: 999999 Funktsioonide leidmine: 1. 5 : 2540BBCF : C6AE945 : 0,2,4,5,b,c,f / 6,9,a,e 2. 7 : 1471C269 : 6D09623 : 1,2,4,6,7,9,c / 0,3,d 3. B : 4F556D8D : 1A71CF2F : 4,5,6,8,d,f / 1,2,7,a,c 4. D : 82F386AB : 2BA68239 : 2,3,6,8,a,b,f / 9 .i 4 .o 4 0000 1-00 0001 01-0 0010 11-1 0011 0-01 0100 1110 0101 1010 0110 -111 0111 01-0 1000 0011 1001 -10- 1010 -0-1 1011 1001 1100 11-0 1101 0-10 1110 -000 1111 1011 .e ------------------------------------------------------------------------ espresso .p 10 -001 0100 -100 1100 1-11 1001 10-0 0011 34 010- 1010 -1-1 0010 0-10 0011 34 0-1- 0100 -01- 0001 0--0 1000 ! !! espresso -Dexact .p 10 -001 0100 010- 1000 1-11 1001 10-0 0011 34 -1-1 0010 0-10 0011 34 0-1- 0100 -100 1110 -01- 0001 0--0 1000 ! !! espresso -Dopoall phase 0000 -- c=10(0) in=28 out=14 tot=42 phase 0001 -- c=10(0) in=29 out=16 tot=45 phase 0010 -- c=11(0) in=29 out=14 tot=43 phase 0011 -- c=10(0) in=28 out=15 tot=43 phase 0100 -- c=10(0) in=28 out=15 tot=43 phase 0101 -- c=10(0) in=28 out=16 tot=44 phase 0110 -- c=9(0) in=26 out=17 tot=43 c phase 0111 -- c=9(0) in=25 out=17 tot=42 c phase 1000 -- c=9(0) in=25 out=15 tot=40 c phase 1001 -- c=10(0) in=26 out=14 tot=40 phase 1010 -- c=10(0) in=25 out=14 tot=39 g phase 1011 -- c=9(0) in=24 out=15 tot=39 c g phase 1100 -- c=9(0) in=25 out=17 tot=42 c phase 1101 -- c=10(0) in=27 out=15 tot=42 phase 1110 -- c=11(0) in=29 out=16 tot=45 phase 1111 -- c=10(0) in=26 out=15 tot=41 espresso -Dopoall #.phase 1010 .p 10 10-0 0110 0101 1100 ! 12 01-1 0001 11-0 1001 1-1- 1100 12 0--0 1000 -1-1 0010 0-0- 0001 -10- 0001 01-- 0010 ! ! espresso -Dopoall #.phase 1011 .p 9 0101 1100 ! 12 1-11 0001 -100 1010 -1-1 0010 -01- 0001 0-10 0011 34 0--0 1000 10-0 0111 34 1-1- 1100 12 ! !! ------------------------------------------------------------------------ espresso -Dopoall + phase 1011 y1 = x1'x2 x3'x4 + x2 x3'x4' + x1'x4' + x1 x3 y2' = x1'x2 x3'x4 + x1 x2'x4' + x1 x3 y3 = x2 x3'x4' + x2 x4 + x1'x3 x4' + x1 x2'x4' y4 = x1 x3 x4 + x2'x3 + x1'x3 x4' + x1 x2'x4' -- fs1_opt0.vhd --------------------------------------------------------- t1 = x1' & x2 & x3' & x4 [ == t4 & x1' & x3' ] t2 = x1 & x3 & x4 t3 = x2 & x3' & x4' t4 = x2 & x4 t5 = x2' & x3 t6 = x1' & x3 & x4' [ == t7 & (x3) ] t7 = x1' & x4' t8 = x1 & x2' & x4' t9 = x1 & x3 y1 = t1 + t3 + t7 + t9 [ == (t1 + t9) + t3 + t7 ] y2 = (t1 + t8 + t9)' [ == ((t1 + t9) + t8)' / (t1 + t8 + t9)' ] y3 = t3 + t4 + t6 + t8 [ == (t6 + t8) + t3 + t4 ] y4 = t2 + t5 + t6 + t8 [ == (t6 + t8) + t2 + t5 ] -- fs1_opt1.vhd --------------------------------------------------------- elementideks #1 (tuumad võivad jaotust muuta!) x1i = x1' [1.5/1.5] 1.5 x2i = x2' [1.5/1.5] 1.5 x3i = x3' [1.5/1.5] 1.5 x4i = x4' [1.5/1.5] 1.5 t1 = t4 & x1i & x3i [2.5/2.5] 4.0 t2 = x1 & x3 & x4 [2.5/2.5] 2.5 t3 = x2 & x3i & x4i [2.5/2.5] 4.0 t4 = x2 & x4 [2.0/2.0] 2.0 t5 = x2i & x3 [2.0/2.0] 3.5 t6 = x3 & t7 [2.0/2.0] 5.5 t7 = x1i & x4i [2.0/2.0] 3.5 t8 = x1 & x2i & x4i [2.5/2.5] 4.0 t9 = x1 & x3 [2.0/2.0] 2.0 t19 = t1 + t9 [2.0/2.0] 6.0 y1 = t19 + t3 + t7 [2.5/2.5] 8.5 y2 = (t19 + t8)' [1.5/1.5] 7.5 (t1 + t8 + t9)' [2.0/2.0] 6.0 [area +0.5] t68 = t6 + t8 [2.0/2.0] 7.5 y3 = t68 + t3 + t4 [2.5/2.5] 10.0 y4 = t68 + t2 + t5 [2.5/2.5] 10.0 19 gates / area 39.0 / delay 7.5...10.0 v.s 19 gates / area 39.5 / delay 6.0...10.0 ------------------------------------------------------------------------ tuumad y1 = x1'x2 x3'x4 + x2 x3'x4' + x1'x4' + x1 x3 /x1' --> x2 x3'x4 + x4' ==> x2 x3' + x4' /x2 x3' --> x1'x4 + x4' ==> x1' + x4' --> 2-NAND / 2-OR /x4' --> x2 x3' + x1' y2' = x1'x2 x3'x4 + x1 x2'x4' + x1 x3 /x1 --> x2'x4' + x3 y3 = x2 x3'x4' + x2 x4 + x1'x3 x4' + x1 x2'x4' /x2 --> x3'x4' + x4 ==> x3' + x4 --> 2-NAND / 2-OR /x4' --> x2 x3' + x1'x3 + x1 x2' ==> 4-OR --> 3-OR + 2-OR y4 = x1 x3 x4 + x2'x3 + x1'x3 x4' + x1 x2'x4' /x1 --> x3 x4 + x2'x4' /x2' --> x3 + x1 x4' /x3 --> x1 x4 + x2' + x1'x4' ==> x1 x4 + x1'x4' == (x1 xor x4)' /x4' --> x1'x3 + x1 x2' järeldused [ 4-AND == 3-AND+2-AND / 4-OR == 3-OR+2-OR ] [ sisendite arvu muutus ] y1: /x2 x3': 4-AND + 3-AND + 4-OR --> 3-AND + 2-OR + 3-OR [ (3+2)+3+(3+2)=13 -> 3+2+3=8 == -5 ] #2 /x1': 4-AND + 2-AND + 4-OR --> 2*2-AND + 2-OR + 3-OR [12->9 - kehvem] /x4': 3-AND + 2-AND + 4-OR --> 2*2-AND + 2-OR + 3-OR [10->9 - veel kehvem] y2': /x1: 3-AND + 2-AND + 3-OR --> 2*2-AND + 2*2-OR [4-AND on alles!] [0] y3: /x2: 3-AND + 2-AND + 4-OR --> 2-AND + 2-OR/2-NAND + 3-OR [10->7] #2 /x4': 3*3-AND + 4-OR --> 3*2-AND + 3-OR + 2-OR [14->11] y4: /x3: 2*3-AND + 4-OR --> 2-XOR + NOT + 3-OR [11->6] #2 /x2': 3-AND + 2-AND + 4-OR --> 2-AND + 2-OR + 3-OR [10->7] /x1: 2*3-AND + 4-OR --> 2*2-AND + 2-OR + 3-OR [11->9] /x4': 2*3-AND + 4-OR --> 2*2-AND + 2-OR + 3-OR [11->9] -- fs1_opt2.vhd --------------------------------------------------------- Variant #2 (y1, y3 & y4 parimad variandid) y1 = (x2 x3') (x1' + x4') + x1'x4' + x1 x3 y2' = (x2 x3') x1'x4 + x1 x2'x4' + x1 x3 [4-AND?! -> 2-AND+3-AND] y3 = x2 (x3' + x4) + x1'x3 x4' + x1 x2'x4' y4 = x3 (x1 xor x4)' + x2'x3 + x1 x2'x4' x1i = x1' [1.5/1.5] 1.5 x2i = x2' [1.5/1.5] 1.5 x3i = x3' [1.5/1.5] 1.5 x4i = x4' [1.5/1.5] 1.5 t1a = x1i + x4i [2.0/2.0] 3.5 t1b = x2 & x3i [2.0/2.0] 3.5 t1c = t1b & t1a [2.0/2.0] 5.5 t1d = t1b & x1i & x4 [2.5/2.5] 6.0 t2a = x1 xor x4 [2.0/2.0] 2.0 t2b = t2a' [1.5/1.5] 3.5 t2c = x3 & t2b [2.0/2.0] 5.5 t3a = x3i + x4 [2.0/2.0] 3.5 t3b = x2 & t3a [2.0/2.0] 5.5 t5 = x2i & x3 [2.0/2.0] 3.5 t6 = x3 & t7 [2.0/2.0] 5.5 t7 = x1i & x4i [2.0/2.0] 3.5 t8 = x1 & x2i & x4i [2.5/2.5] 4.0 t9 = x1 & x3 [2.0/2.0] 2.0 y1 = t1c + t7 + t9 [2.5/2.5] 8.5 y2 = (t1d + t8 + t9)' [2.0/2.0] 8.0 y3 = t3b + t6 + t8 [2.5/2.5] 8.0 y4 = t2c + t5 + t8 [2.5/2.5] 8.0 22 gates / area 44.0 / delay 8.0...8.5 elementide arv & pindala suurenes, viide paranes (kiirem & ühtlasem) ------------------------------------------------------------------------ Variant #1 optimeerimine x1i = x1' ===> x1i = (x1 & x1)' [1.0/1.0] 1.0 x2i = x2' ===> x2i = (x2 & x2)' [1.0/1.0] 1.0 x3i = x3' ===> x3i = (x3 & x3)' [1.0/1.0] 1.0 x4i = x4' ===> x4i = (x4 & x4)' [1.0/1.0] 1.0 t2 = x1 & x3 & x4 ===> t2i = (x1 & x3 & x4)' [1.5/1.5] 1.5 t3 = x2 & x3i & x4i =1=> t3i = (x2 & x3i & x4i)' [1.5/1.5] 2.5 =2=> t3x = (x3 + x4)' [1.5/1.5] 1.5 t3i = (x1 & t3x)' [1.0/1.0] 2.5 [1 vajab x3 & x4 inverteeritult, nende kadumine vähendaks suurust!!] [2 on pindalalt suurem (kuid pluss invertorid!), viide sama] [x3i & x4i pole mujal vaja --> variant 2 on parem] t4 = x2 & x4 ===> t4i = (x2 & x4)' [1.0/1.0] 1.0 t5 = x2i & x3 ===> t5i = (x2i & x3)' [1.0/1.0] 2.0 t6 = x3 & t7 [2.0/2.0] 3.5 t7 = x1i & x4i ===> t7 = (x1 + x4)' [1.5/1.5] 1.5 t8 = x1 & x2i & x4i ===> t8x = (x2 + x4)' [1.5/1.5] 1.5 t8 = x1 & t8x [2.0/2.0] 3.5 t68 = t6 + t8 ===> t68i = (t6 + t8)' [1.5/1.5] 5.0 t1 = t4 & x1i & x3i =1=> t1 = (t4i + x1 + x3)' [2.0/2.0] 3.0 t9 = x1 & x3 =1=> t9 = x1 & x3 [2.0/2.0] 2.0 t19 = t1 + t9 =1=> t19 = t1 + t9 [2.0/2.0] 5.0 =2=> t1i = t4i + x1 + x3 [2.5/2.5] 3.5 =2=> t9i = (x1 & x3)' [1.0/1.0] 1.0 =2=> t19 = (t1i & t9i)' [1.0/1.0] 4.5 [1: 6.0/5.0 & 2: 4.5/4.5 --> variant 2 on parem] y1 = t19 + t3 + t7 ===> t197i = (t19 + t7)' [1.5/1.5] 6.0 y1 = (t197i & t3i)' [1.0/1.0] 7.0 y2 = (t19 + t8)' =1=> y2 = (t19 + t8)' [1.5/1.5] 6.0 =2=> y2 = (t1 + t8 + t9)' [2.0/2.0] 6.5 [variant 1 on väiksem ja kiirem, vt. ka t19 variante] y3 = t68 + t3 + t4 ===> y3 = (t68i & t3i & t4i)' [1.5/1.5] 6.5 y4 = t68 + t2 + t5 ==> y4 = (t68i & t2i & t5i)' [1.5/1.5] 6.5 -- fs1_opt1o.vhd -------------------------------------------------------- Optimeeritud variant #1 x1i = (x1 & x1)' [1.0/1.0] 1.0 x2i = (x2 & x2)' [1.0/1.0] 1.0 t1i = t4i + x1 + x3 [2.5/2.5] 3.5 t2i = (x1 & x3 & x4)' [1.5/1.5] 1.5 t3x = (x3 + x4)' [1.5/1.5] 1.5 t3i = (x1 & t3x)' [1.0/1.0] 2.5 t4i = (x2 & x4)' [1.0/1.0] 1.0 t5i = (x2i & x3)' [1.0/1.0] 2.0 t6 = x3 & t7 [2.0/2.0] 3.5 t7 = (x1 + x4)' [1.5/1.5] 1.5 t8x = (x2 + x4)' [1.5/1.5] 1.5 t8 = x1 & t8x [2.0/2.0] 3.5 t68i = (t6 + t8)' [1.5/1.5] 5.0 t9i = (x1 & x3)' [1.0/1.0] 1.0 t19 = (t1i & t9i)' [1.0/1.0] 4.5 t197i = (t19 + t7)' [1.5/1.5] 6.0 y1 = (t197i & t3i)' [1.0/1.0] 7.0 y2 = (t19 + t8)' [1.5/1.5] 6.0 y3 = (t68i & t3i & t4i)' [1.5/1.5] 6.5 y4 = (t68i & t2i & t5i)' [1.5/1.5] 6.5 20 gates [+5.3%] / area 28 [-28.2%] / delay 6.0...7.0 // 19 gates / area 39.0 / delay 7.5...10.0 v.s // 19 gates / area 39.5 / delay 6.0...10.0) ------------------------------------------------------------------------ Variant #2 optimeerimine x1i = x1' ===> x1i = (x1 & x1)' [1.0/1.0] 1.0 x2i = x2' ===> x2i = (x2 & x2)' [1.0/1.0] 1.0 x3i = x3' ===> x3i = (x3 & x3)' [1.0/1.0] 1.0 x4i = x4' ===> x4i = (x4 & x4)' [1.0/1.0] 1.0 t1a = x1i + x4i ===> t1ai = (x1 & x4)' [1.0/1.0] 1.0 t1b = x2 & x3i [2.0/2.0] 3.5 t1c = t1b & t1a [2.0/2.0] 5.5 t1d = t1b & x1i & x4 [2.5/2.5] 6.0 t2a = x1 xor x4 [2.0/2.0] 2.0 t2b = t2a' [1.5/1.5] 3.5 t2c = x3 & t2b [2.0/2.0] 5.5 t3a = x3i + x4 [2.0/2.0] 3.5 t3b = x2 & t3a [2.0/2.0] 5.5 t5 = x2i & x3 [2.0/2.0] 3.5 t6 = x3 & t7 ===> t6i = (x3 & t7)' [1.0/1.0] 2.5 t7 = x1i & x4i ===> t7 = (x1 + x4)' [1.5/1.5] 1.5 t8 = x1 & x2i & x4i ===> t8 = (x1 & x2i & x4i)' [1.5/1.5] 2.5???? t9 = x1 & x3 ===> t9i = (x1 & x3)' [1.0/1.0] 1.0 y1 = t1c + t7 + t9 ===> y1 = t1c + t7 + t9i' [2.5/2.5] ?.? y2 = (t1d + t8 + t9)' ===> y2 = (t1d + t8 + t9i')' [2.0/2.0] ?.? y3 = t3b + t6 + t8 ===> y3 = t3b + t6i' + t8i' [2.5/2.5] ?.? y4 = t2c + t5 + t8 ===> y4 = t2c + t5 + t8i' [2.5/2.5] ?.? // 22 gates / area 44.0 / delay 8.0...8.5 ------------------------------------------------------------------------ Variant #3 jne. võimalused? Pindala & viite võrdlemine, pluss dubleerimisega arvestamine. y1 [#1] - t3, t7, t19 [t1, t9] -- area / delay? y2 [#1] - t8, t19 [t1, t9] y3 [#1] - t3, t4, t68 [t6, t8] y4 [#1] - t2, t5, t68 [t6, t8]