/*** * 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, S. S. Sarwar, L. Sekanina, Z. Vasicek and K. Roy, "Design of power-efficient approximate multipliers for approximate artificial neural networks," 2016 IEEE/ACM International Conference on Computer-Aided Design (ICCAD), Austin, TX, 2016, pp. 1-7. doi: 10.1145/2966986.2967021 * This file contains a circuit from a sub-set of pareto optimal circuits with respect to the pwr and mre parameters ***/ // MAE% = 0.45 % // MAE = 74 // WCE% = 1.92 % // WCE = 314 // WCRE% = 700.00 % // EP% = 97.31 % // MRE% = 8.23 % // MSE = 8544 // PDK45_PWR = 0.152 mW // PDK45_AREA = 295.7 um2 // PDK45_DELAY = 1.05 ns #include #include uint64_t mul7u_081(uint64_t a, uint64_t b) { int wa[7]; int wb[7]; uint64_t y = 0; wa[0] = (a >> 0) & 0x01; wb[0] = (b >> 0) & 0x01; wa[1] = (a >> 1) & 0x01; wb[1] = (b >> 1) & 0x01; wa[2] = (a >> 2) & 0x01; wb[2] = (b >> 2) & 0x01; wa[3] = (a >> 3) & 0x01; wb[3] = (b >> 3) & 0x01; wa[4] = (a >> 4) & 0x01; wb[4] = (b >> 4) & 0x01; wa[5] = (a >> 5) & 0x01; wb[5] = (b >> 5) & 0x01; wa[6] = (a >> 6) & 0x01; wb[6] = (b >> 6) & 0x01; int sig_27 = wa[6] & wb[1]; int sig_33 = wa[5] & wb[2]; int sig_34 = wa[6] & wb[2]; int sig_39 = wa[4] & wb[3]; int sig_40 = wa[5] & wb[3]; int sig_41 = wa[6] & wb[3]; int sig_45 = wa[1] & wb[3]; int sig_46 = wa[4] & wb[4]; int sig_47 = wa[5] & wb[4]; int sig_48 = wa[6] & wb[4]; int sig_51 = wa[6] & wb[0]; int sig_52 = wa[3] & wb[5]; int sig_53 = wa[4] & wb[5]; int sig_54 = wa[5] & wb[5]; int sig_55 = wa[6] & wb[5]; int sig_57 = wa[3] & wb[4]; int sig_58 = wa[2] & wb[6]; int sig_59 = wa[3] & wb[6]; int sig_60 = wa[4] & wb[6]; int sig_61 = wa[5] & wb[6]; int sig_62 = wa[6] & wb[6]; int sig_89 = wb[2] & wa[4]; int sig_90 = sig_27 & sig_33; int sig_91 = sig_27 ^ sig_33; int sig_103 = wa[5] & wb[1]; int sig_104 = sig_39 ^ sig_45; int sig_105 = sig_39 & wa[1]; int sig_106 = sig_104 & sig_51; int sig_107 = sig_104 ^ sig_51; int sig_108 = sig_105 ^ sig_106; int sig_109 = sig_40 ^ sig_46; int sig_110 = sig_40 & sig_46; int sig_111 = sig_109 & sig_52; int sig_112 = sig_109 ^ sig_52; int sig_113 = sig_110 ^ sig_111; int sig_114 = sig_41 ^ sig_47; int sig_115 = sig_41 & sig_47; int sig_116 = sig_114 & sig_53; int sig_117 = sig_114 ^ sig_53; int sig_118 = sig_115 ^ sig_116; int sig_119 = sig_48 & sig_54; int sig_120 = sig_48 ^ sig_54; int sig_142 = wb[4] & wa[3]; int sig_143 = sig_91 ^ sig_89; int sig_144 = sig_91 & sig_89; int sig_145 = sig_143 & sig_107; int sig_146 = sig_143 ^ sig_107; int sig_147 = sig_144 ^ sig_145; int sig_148 = sig_34 ^ sig_90; int sig_149 = wa[5] & sig_90; int sig_150 = sig_148 & sig_112; int sig_151 = sig_148 ^ sig_112; int sig_152 = sig_149 | sig_150; int sig_166 = wb[6] & wa[1]; int sig_167 = sig_146 ^ sig_142; int sig_168 = sig_146 & sig_142; int sig_169 = sig_167 & sig_103; int sig_170 = sig_167 ^ sig_103; int sig_171 = sig_168 ^ sig_169; int sig_172 = sig_151 ^ sig_147; int sig_173 = sig_151 & sig_147; int sig_174 = sig_172 & sig_108; int sig_175 = sig_172 ^ sig_108; int sig_176 = sig_173 ^ sig_174; int sig_177 = sig_117 ^ sig_152; int sig_178 = sig_117 & sig_152; int sig_179 = sig_177 & sig_113; int sig_180 = sig_177 ^ sig_113; int sig_181 = sig_178 | sig_179; int sig_182 = sig_120 & sig_118; int sig_183 = sig_120 ^ sig_118; int sig_184 = wb[5] & sig_119; int sig_185 = sig_55 ^ sig_119; int sig_195 = sig_170 ^ sig_166; int sig_196 = sig_170 & sig_166; int sig_197 = sig_195 & sig_57; int sig_198 = sig_195 ^ sig_57; int sig_199 = sig_196 ^ sig_197; int sig_200 = sig_175 ^ sig_171; int sig_201 = sig_175 & sig_171; int sig_202 = sig_200 & sig_58; int sig_203 = sig_200 ^ sig_58; int sig_204 = sig_201 ^ sig_202; int sig_205 = sig_180 ^ sig_176; int sig_206 = sig_180 & sig_176; int sig_207 = sig_205 & sig_59; int sig_208 = sig_205 ^ sig_59; int sig_209 = sig_206 ^ sig_207; int sig_210 = sig_183 ^ sig_181; int sig_211 = sig_183 & sig_181; int sig_212 = sig_210 & sig_60; int sig_213 = sig_210 ^ sig_60; int sig_214 = sig_211 | sig_212; int sig_215 = sig_185 ^ sig_182; int sig_216 = sig_185 & sig_182; int sig_217 = sig_215 & sig_61; int sig_218 = sig_215 ^ sig_61; int sig_219 = sig_216 | sig_217; int sig_220 = sig_184 & wb[6]; int sig_221 = sig_184 ^ sig_62; int sig_233 = wb[5] & wa[2]; int sig_234 = sig_203 ^ sig_199; int sig_235 = sig_203 & sig_199; int sig_236 = sig_234 & sig_233; int sig_237 = sig_234 ^ sig_233; int sig_238 = sig_235 ^ sig_236; int sig_239 = sig_208 ^ sig_204; int sig_240 = sig_208 & sig_204; int sig_241 = sig_239 & sig_238; int sig_242 = sig_239 ^ sig_238; int sig_243 = sig_240 ^ sig_241; int sig_244 = sig_213 ^ sig_209; int sig_245 = sig_213 & sig_209; int sig_246 = sig_244 & sig_243; int sig_247 = sig_244 ^ sig_243; int sig_248 = sig_245 ^ sig_246; int sig_249 = sig_218 ^ sig_214; int sig_250 = sig_218 & sig_214; int sig_251 = sig_249 & sig_248; int sig_252 = sig_249 ^ sig_248; int sig_253 = sig_250 ^ sig_251; int sig_254 = sig_221 ^ sig_219; int sig_255 = sig_221 & sig_219; int sig_256 = sig_254 & sig_253; int sig_257 = sig_254 ^ sig_253; int sig_258 = sig_255 ^ sig_256; int sig_260 = sig_220 | sig_258; y |= (sig_246 & 0x01) << 0; // default output y |= (sig_117 & 0x01) << 1; // default output y |= (sig_53 & 0x01) << 2; // default output y |= (sig_142 & 0x01) << 3; // default output y |= (sig_115 & 0x01) << 4; // default output y |= (sig_41 & 0x01) << 5; // default output y |= (sig_90 & 0x01) << 6; // default output y |= (sig_198 & 0x01) << 7; // default output y |= (sig_237 & 0x01) << 8; // default output y |= (sig_242 & 0x01) << 9; // default output y |= (sig_247 & 0x01) << 10; // default output y |= (sig_252 & 0x01) << 11; // default output y |= (sig_257 & 0x01) << 12; // default output y |= (sig_260 & 0x01) << 13; // default output return y; }