/*** * This code is a part of EvoApproxLib library (ehw.fit.vutbr.cz/approxlib) distributed under The MIT License. * When used, please cite the following article(s): V. Mrazek, Z. Vasicek, L. Sekanina, H. Jiang and J. Han, "Scalable Construction of Approximate Multipliers With Formally Guaranteed Worst Case Error" in IEEE Transactions on Very Large Scale Integration (VLSI) Systems, vol. 26, no. 11, pp. 2572-2576, Nov. 2018. doi: 10.1109/TVLSI.2018.2856362 * This file contains a circuit from a sub-set of pareto optimal circuits with respect to the pwr and mse parameters ***/ // MAE% = 0.16 % // MAE = 6782976 // WCE% = 0.63 % // WCE = 27131905 // WCRE% = 100.00 % // EP% = 100.00 % // MRE% = 3.06 % // MSE = 55158.891e9 // PDK45_PWR = 0.401 mW // PDK45_AREA = 642.0 um2 // PDK45_DELAY = 1.97 ns #include #include uint32_t mul16u_G88(uint16_t A, uint16_t B) { uint32_t P, P_; uint16_t tmp, C_10_11,C_10_12,C_10_13,C_10_14,C_11_10,C_11_11,C_11_12,C_11_13,C_11_14,C_12_10,C_12_11,C_12_12,C_12_13,C_12_14,C_12_9,C_13_10,C_13_11,C_13_12,C_13_13,C_13_14,C_13_8,C_13_9,C_14_10,C_14_11,C_14_12,C_14_13,C_14_14,C_14_7,C_14_8,C_14_9,C_15_10,C_15_11,C_15_12,C_15_13,C_15_14,C_15_6,C_15_7,C_15_8,C_15_9,C_16_10,C_16_11,C_16_12,C_16_13,C_16_14,C_16_6,C_16_7,C_16_8,C_16_9,C_8_13,C_8_14,C_9_12,C_9_13,C_9_14,S_10_11,S_10_12,S_10_13,S_10_14,S_10_15,S_11_10,S_11_11,S_11_12,S_11_13,S_11_14,S_11_15,S_12_10,S_12_11,S_12_12,S_12_13,S_12_14,S_12_15,S_12_9,S_13_10,S_13_11,S_13_12,S_13_13,S_13_14,S_13_15,S_13_8,S_13_9,S_14_10,S_14_11,S_14_12,S_14_13,S_14_14,S_14_15,S_14_7,S_14_8,S_14_9,S_15_10,S_15_11,S_15_12,S_15_13,S_15_14,S_15_15,S_15_6,S_15_7,S_15_8,S_15_9,S_16_10,S_16_11,S_16_12,S_16_13,S_16_14,S_16_15,S_16_5,S_16_6,S_16_7,S_16_8,S_16_9,S_7_14,S_7_15,S_8_13,S_8_14,S_8_15,S_9_12,S_9_13,S_9_14,S_9_15; S_7_14 = (((A>>7)&1) & ((B>>14)&1)); S_7_15 = (((A>>7)&1) & ((B>>15)&1)); S_8_13 = S_7_14^(((A>>8)&1) & ((B>>13)&1)); C_8_13 = S_7_14&(((A>>8)&1) & ((B>>13)&1)); S_8_14 = S_7_15^(((A>>8)&1) & ((B>>14)&1)); C_8_14 = S_7_15&(((A>>8)&1) & ((B>>14)&1)); S_8_15 = (((A>>8)&1) & ((B>>15)&1)); S_9_12 = S_8_13^(((A>>9)&1) & ((B>>12)&1)); C_9_12 = S_8_13&(((A>>9)&1) & ((B>>12)&1)); tmp = S_8_14^C_8_13; S_9_13 = tmp^(((A>>9)&1) & ((B>>13)&1)); C_9_13 = (tmp&(((A>>9)&1) & ((B>>13)&1)))|(S_8_14&C_8_13); tmp = S_8_15^C_8_14; S_9_14 = tmp^(((A>>9)&1) & ((B>>14)&1)); C_9_14 = (tmp&(((A>>9)&1) & ((B>>14)&1)))|(S_8_15&C_8_14); S_9_15 = (((A>>9)&1) & ((B>>15)&1)); S_10_11 = S_9_12^(((A>>10)&1) & ((B>>11)&1)); C_10_11 = S_9_12&(((A>>10)&1) & ((B>>11)&1)); tmp = S_9_13^C_9_12; S_10_12 = tmp^(((A>>10)&1) & ((B>>12)&1)); C_10_12 = (tmp&(((A>>10)&1) & ((B>>12)&1)))|(S_9_13&C_9_12); tmp = S_9_14^C_9_13; S_10_13 = tmp^(((A>>10)&1) & ((B>>13)&1)); C_10_13 = (tmp&(((A>>10)&1) & ((B>>13)&1)))|(S_9_14&C_9_13); tmp = S_9_15^C_9_14; S_10_14 = tmp^(((A>>10)&1) & ((B>>14)&1)); C_10_14 = (tmp&(((A>>10)&1) & ((B>>14)&1)))|(S_9_15&C_9_14); S_10_15 = (((A>>10)&1) & ((B>>15)&1)); S_11_10 = S_10_11^(((A>>11)&1) & ((B>>10)&1)); C_11_10 = S_10_11&(((A>>11)&1) & ((B>>10)&1)); tmp = S_10_12^C_10_11; S_11_11 = tmp^(((A>>11)&1) & ((B>>11)&1)); C_11_11 = (tmp&(((A>>11)&1) & ((B>>11)&1)))|(S_10_12&C_10_11); tmp = S_10_13^C_10_12; S_11_12 = tmp^(((A>>11)&1) & ((B>>12)&1)); C_11_12 = (tmp&(((A>>11)&1) & ((B>>12)&1)))|(S_10_13&C_10_12); tmp = S_10_14^C_10_13; S_11_13 = tmp^(((A>>11)&1) & ((B>>13)&1)); C_11_13 = (tmp&(((A>>11)&1) & ((B>>13)&1)))|(S_10_14&C_10_13); tmp = S_10_15^C_10_14; S_11_14 = tmp^(((A>>11)&1) & ((B>>14)&1)); C_11_14 = (tmp&(((A>>11)&1) & ((B>>14)&1)))|(S_10_15&C_10_14); S_11_15 = (((A>>11)&1) & ((B>>15)&1)); S_12_9 = S_11_10^(((A>>12)&1) & ((B>>9)&1)); C_12_9 = S_11_10&(((A>>12)&1) & ((B>>9)&1)); tmp = S_11_11^C_11_10; S_12_10 = tmp^(((A>>12)&1) & ((B>>10)&1)); C_12_10 = (tmp&(((A>>12)&1) & ((B>>10)&1)))|(S_11_11&C_11_10); tmp = S_11_12^C_11_11; S_12_11 = tmp^(((A>>12)&1) & ((B>>11)&1)); C_12_11 = (tmp&(((A>>12)&1) & ((B>>11)&1)))|(S_11_12&C_11_11); tmp = S_11_13^C_11_12; S_12_12 = tmp^(((A>>12)&1) & ((B>>12)&1)); C_12_12 = (tmp&(((A>>12)&1) & ((B>>12)&1)))|(S_11_13&C_11_12); tmp = S_11_14^C_11_13; S_12_13 = tmp^(((A>>12)&1) & ((B>>13)&1)); C_12_13 = (tmp&(((A>>12)&1) & ((B>>13)&1)))|(S_11_14&C_11_13); tmp = S_11_15^C_11_14; S_12_14 = tmp^(((A>>12)&1) & ((B>>14)&1)); C_12_14 = (tmp&(((A>>12)&1) & ((B>>14)&1)))|(S_11_15&C_11_14); S_12_15 = (((A>>12)&1) & ((B>>15)&1)); S_13_8 = S_12_9^(((A>>13)&1) & ((B>>8)&1)); C_13_8 = S_12_9&(((A>>13)&1) & ((B>>8)&1)); tmp = S_12_10^C_12_9; S_13_9 = tmp^(((A>>13)&1) & ((B>>9)&1)); C_13_9 = (tmp&(((A>>13)&1) & ((B>>9)&1)))|(S_12_10&C_12_9); tmp = S_12_11^C_12_10; S_13_10 = tmp^(((A>>13)&1) & ((B>>10)&1)); C_13_10 = (tmp&(((A>>13)&1) & ((B>>10)&1)))|(S_12_11&C_12_10); tmp = S_12_12^C_12_11; S_13_11 = tmp^(((A>>13)&1) & ((B>>11)&1)); C_13_11 = (tmp&(((A>>13)&1) & ((B>>11)&1)))|(S_12_12&C_12_11); tmp = S_12_13^C_12_12; S_13_12 = tmp^(((A>>13)&1) & ((B>>12)&1)); C_13_12 = (tmp&(((A>>13)&1) & ((B>>12)&1)))|(S_12_13&C_12_12); tmp = S_12_14^C_12_13; S_13_13 = tmp^(((A>>13)&1) & ((B>>13)&1)); C_13_13 = (tmp&(((A>>13)&1) & ((B>>13)&1)))|(S_12_14&C_12_13); tmp = S_12_15^C_12_14; S_13_14 = tmp^(((A>>13)&1) & ((B>>14)&1)); C_13_14 = (tmp&(((A>>13)&1) & ((B>>14)&1)))|(S_12_15&C_12_14); S_13_15 = (((A>>13)&1) & ((B>>15)&1)); S_14_7 = S_13_8^(((A>>14)&1) & ((B>>7)&1)); C_14_7 = S_13_8&(((A>>14)&1) & ((B>>7)&1)); tmp = S_13_9^C_13_8; S_14_8 = tmp^(((A>>14)&1) & ((B>>8)&1)); C_14_8 = (tmp&(((A>>14)&1) & ((B>>8)&1)))|(S_13_9&C_13_8); tmp = S_13_10^C_13_9; S_14_9 = tmp^(((A>>14)&1) & ((B>>9)&1)); C_14_9 = (tmp&(((A>>14)&1) & ((B>>9)&1)))|(S_13_10&C_13_9); tmp = S_13_11^C_13_10; S_14_10 = tmp^(((A>>14)&1) & ((B>>10)&1)); C_14_10 = (tmp&(((A>>14)&1) & ((B>>10)&1)))|(S_13_11&C_13_10); tmp = S_13_12^C_13_11; S_14_11 = tmp^(((A>>14)&1) & ((B>>11)&1)); C_14_11 = (tmp&(((A>>14)&1) & ((B>>11)&1)))|(S_13_12&C_13_11); tmp = S_13_13^C_13_12; S_14_12 = tmp^(((A>>14)&1) & ((B>>12)&1)); C_14_12 = (tmp&(((A>>14)&1) & ((B>>12)&1)))|(S_13_13&C_13_12); tmp = S_13_14^C_13_13; S_14_13 = tmp^(((A>>14)&1) & ((B>>13)&1)); C_14_13 = (tmp&(((A>>14)&1) & ((B>>13)&1)))|(S_13_14&C_13_13); tmp = S_13_15^C_13_14; S_14_14 = tmp^(((A>>14)&1) & ((B>>14)&1)); C_14_14 = (tmp&(((A>>14)&1) & ((B>>14)&1)))|(S_13_15&C_13_14); S_14_15 = (((A>>14)&1) & ((B>>15)&1)); S_15_6 = S_14_7^(((A>>15)&1) & ((B>>6)&1)); C_15_6 = S_14_7&(((A>>15)&1) & ((B>>6)&1)); tmp = S_14_8^C_14_7; S_15_7 = tmp^(((A>>15)&1) & ((B>>7)&1)); C_15_7 = (tmp&(((A>>15)&1) & ((B>>7)&1)))|(S_14_8&C_14_7); tmp = S_14_9^C_14_8; S_15_8 = tmp^(((A>>15)&1) & ((B>>8)&1)); C_15_8 = (tmp&(((A>>15)&1) & ((B>>8)&1)))|(S_14_9&C_14_8); tmp = S_14_10^C_14_9; S_15_9 = tmp^(((A>>15)&1) & ((B>>9)&1)); C_15_9 = (tmp&(((A>>15)&1) & ((B>>9)&1)))|(S_14_10&C_14_9); tmp = S_14_11^C_14_10; S_15_10 = tmp^(((A>>15)&1) & ((B>>10)&1)); C_15_10 = (tmp&(((A>>15)&1) & ((B>>10)&1)))|(S_14_11&C_14_10); tmp = S_14_12^C_14_11; S_15_11 = tmp^(((A>>15)&1) & ((B>>11)&1)); C_15_11 = (tmp&(((A>>15)&1) & ((B>>11)&1)))|(S_14_12&C_14_11); tmp = S_14_13^C_14_12; S_15_12 = tmp^(((A>>15)&1) & ((B>>12)&1)); C_15_12 = (tmp&(((A>>15)&1) & ((B>>12)&1)))|(S_14_13&C_14_12); tmp = S_14_14^C_14_13; S_15_13 = tmp^(((A>>15)&1) & ((B>>13)&1)); C_15_13 = (tmp&(((A>>15)&1) & ((B>>13)&1)))|(S_14_14&C_14_13); tmp = S_14_15^C_14_14; S_15_14 = tmp^(((A>>15)&1) & ((B>>14)&1)); C_15_14 = (tmp&(((A>>15)&1) & ((B>>14)&1)))|(S_14_15&C_14_14); S_15_15 = (((A>>15)&1) & ((B>>15)&1)); S_16_5 = S_15_6; S_16_6 = S_15_7^C_15_6; C_16_6 = S_15_7&C_15_6; tmp = S_15_8^C_16_6; S_16_7 = tmp^C_15_7; C_16_7 = (tmp&C_15_7)|(S_15_8&C_16_6); tmp = S_15_9^C_16_7; S_16_8 = tmp^C_15_8; C_16_8 = (tmp&C_15_8)|(S_15_9&C_16_7); tmp = S_15_10^C_16_8; S_16_9 = tmp^C_15_9; C_16_9 = (tmp&C_15_9)|(S_15_10&C_16_8); tmp = S_15_11^C_16_9; S_16_10 = tmp^C_15_10; C_16_10 = (tmp&C_15_10)|(S_15_11&C_16_9); tmp = S_15_12^C_16_10; S_16_11 = tmp^C_15_11; C_16_11 = (tmp&C_15_11)|(S_15_12&C_16_10); tmp = S_15_13^C_16_11; S_16_12 = tmp^C_15_12; C_16_12 = (tmp&C_15_12)|(S_15_13&C_16_11); tmp = S_15_14^C_16_12; S_16_13 = tmp^C_15_13; C_16_13 = (tmp&C_15_13)|(S_15_14&C_16_12); tmp = S_15_15^C_16_13; S_16_14 = tmp^C_15_14; C_16_14 = (tmp&C_15_14)|(S_15_15&C_16_13); S_16_15 = C_16_14; P = 0; P |= (S_16_5 & 1) << 21; P |= (S_16_6 & 1) << 22; P |= (S_16_7 & 1) << 23; P |= (S_16_8 & 1) << 24; P |= (S_16_9 & 1) << 25; P |= (S_16_10 & 1) << 26; P |= (S_16_11 & 1) << 27; P |= (S_16_12 & 1) << 28; P |= (S_16_13 & 1) << 29; P |= (S_16_14 & 1) << 30; P |= (S_16_15 & 1) << 31; return P; }