/*** * 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, R. Hrbacek, Z. Vasicek and L. Sekanina, "EvoApprox8b: Library of approximate adders and multipliers for circuit design and benchmarking of approximation methods". Design, Automation & Test in Europe Conference & Exhibition (DATE), 2017, Lausanne, 2017, pp. 258-261. doi: 10.23919/DATE.2017.7926993 * This file contains a circuit from a sub-set of pareto optimal circuits with respect to the pwr and mae parameters ***/ // MAE% = 0.00 % // MAE = 0 // WCE% = 0.00 % // WCE = 0 // WCRE% = 0.00 % // EP% = 0.00 % // MRE% = 0.00 % // MSE = 0 // PDK45_PWR = 0.391 mW // PDK45_AREA = 709.6 um2 // PDK45_DELAY = 1.43 ns #include #include uint16_t mul8u_1JJQ(uint8_t a, uint8_t b) { uint16_t c = 0; uint8_t n0 = (a >> 0) & 0x1; uint8_t n2 = (a >> 1) & 0x1; uint8_t n4 = (a >> 2) & 0x1; uint8_t n6 = (a >> 3) & 0x1; uint8_t n8 = (a >> 4) & 0x1; uint8_t n10 = (a >> 5) & 0x1; uint8_t n12 = (a >> 6) & 0x1; uint8_t n14 = (a >> 7) & 0x1; uint8_t n16 = (b >> 0) & 0x1; uint8_t n18 = (b >> 1) & 0x1; uint8_t n20 = (b >> 2) & 0x1; uint8_t n22 = (b >> 3) & 0x1; uint8_t n24 = (b >> 4) & 0x1; uint8_t n26 = (b >> 5) & 0x1; uint8_t n28 = (b >> 6) & 0x1; uint8_t n30 = (b >> 7) & 0x1; uint8_t n32; uint8_t n34; uint8_t n36; uint8_t n38; uint8_t n40; uint8_t n42; uint8_t n44; uint8_t n46; uint8_t n48; uint8_t n50; uint8_t n52; uint8_t n54; uint8_t n56; uint8_t n58; uint8_t n60; uint8_t n62; uint8_t n64; uint8_t n65; uint8_t n66; uint8_t n67; uint8_t n68; uint8_t n69; uint8_t n70; uint8_t n71; uint8_t n72; uint8_t n73; uint8_t n74; uint8_t n75; uint8_t n76; uint8_t n77; uint8_t n78; uint8_t n80; uint8_t n82; uint8_t n84; uint8_t n86; uint8_t n88; uint8_t n90; uint8_t n92; uint8_t n94; uint8_t n95; uint8_t n96; uint8_t n97; uint8_t n98; uint8_t n99; uint8_t n100; uint8_t n101; uint8_t n102; uint8_t n103; uint8_t n104; uint8_t n105; uint8_t n106; uint8_t n107; uint8_t n108; uint8_t n110; uint8_t n112; uint8_t n114; uint8_t n116; uint8_t n118; uint8_t n120; uint8_t n122; uint8_t n124; uint8_t n125; uint8_t n126; uint8_t n127; uint8_t n128; uint8_t n129; uint8_t n130; uint8_t n131; uint8_t n132; uint8_t n133; uint8_t n134; uint8_t n135; uint8_t n136; uint8_t n137; uint8_t n138; uint8_t n140; uint8_t n142; uint8_t n144; uint8_t n146; uint8_t n148; uint8_t n150; uint8_t n152; uint8_t n154; uint8_t n155; uint8_t n156; uint8_t n157; uint8_t n158; uint8_t n159; uint8_t n160; uint8_t n161; uint8_t n162; uint8_t n163; uint8_t n164; uint8_t n165; uint8_t n166; uint8_t n167; uint8_t n168; uint8_t n170; uint8_t n172; uint8_t n174; uint8_t n176; uint8_t n178; uint8_t n180; uint8_t n182; uint8_t n184; uint8_t n185; uint8_t n186; uint8_t n187; uint8_t n188; uint8_t n189; uint8_t n190; uint8_t n191; uint8_t n192; uint8_t n193; uint8_t n194; uint8_t n195; uint8_t n196; uint8_t n197; uint8_t n198; uint8_t n200; uint8_t n202; uint8_t n204; uint8_t n206; uint8_t n208; uint8_t n210; uint8_t n212; uint8_t n214; uint8_t n215; uint8_t n216; uint8_t n217; uint8_t n218; uint8_t n219; uint8_t n220; uint8_t n221; uint8_t n222; uint8_t n223; uint8_t n224; uint8_t n225; uint8_t n226; uint8_t n227; uint8_t n228; uint8_t n230; uint8_t n232; uint8_t n234; uint8_t n236; uint8_t n238; uint8_t n240; uint8_t n242; uint8_t n244; uint8_t n245; uint8_t n246; uint8_t n247; uint8_t n248; uint8_t n249; uint8_t n250; uint8_t n251; uint8_t n252; uint8_t n253; uint8_t n254; uint8_t n255; uint8_t n256; uint8_t n257; uint8_t n258; uint8_t n259; uint8_t n260; uint8_t n261; uint8_t n262; uint8_t n263; uint8_t n264; uint8_t n265; uint8_t n266; uint8_t n267; uint8_t n268; uint8_t n269; uint8_t n270; uint8_t n271; n32 = n0 & n16; n34 = n2 & n16; n36 = n4 & n16; n38 = n6 & n16; n40 = n8 & n16; n42 = n10 & n16; n44 = n12 & n16; n46 = n14 & n16; n48 = n0 & n18; n50 = n2 & n18; n52 = n4 & n18; n54 = n6 & n18; n56 = n8 & n18; n58 = n10 & n18; n60 = n12 & n18; n62 = n14 & n18; n64 = n34 ^ n48; n65 = n34 & n48; n66 = n36 ^ n50; n67 = n36 & n50; n68 = n38 ^ n52; n69 = n38 & n52; n70 = n40 ^ n54; n71 = n40 & n54; n72 = n42 ^ n56; n73 = n42 & n56; n74 = n44 ^ n58; n75 = n44 & n58; n76 = n46 ^ n60; n77 = n46 & n60; n78 = n0 & n20; n80 = n2 & n20; n82 = n4 & n20; n84 = n6 & n20; n86 = n8 & n20; n88 = n10 & n20; n90 = n12 & n20; n92 = n14 & n20; n94 = (n66 ^ n78) ^ n65; n95 = (n66 & n78) | (n78 & n65) | (n66 & n65); n96 = (n68 ^ n80) ^ n67; n97 = (n68 & n80) | (n80 & n67) | (n68 & n67); n98 = (n70 ^ n82) ^ n69; n99 = (n70 & n82) | (n82 & n69) | (n70 & n69); n100 = (n72 ^ n84) ^ n71; n101 = (n72 & n84) | (n84 & n71) | (n72 & n71); n102 = (n74 ^ n86) ^ n73; n103 = (n74 & n86) | (n86 & n73) | (n74 & n73); n104 = (n76 ^ n88) ^ n75; n105 = (n76 & n88) | (n88 & n75) | (n76 & n75); n106 = (n62 ^ n90) ^ n77; n107 = (n62 & n90) | (n90 & n77) | (n62 & n77); n108 = n0 & n22; n110 = n2 & n22; n112 = n4 & n22; n114 = n6 & n22; n116 = n8 & n22; n118 = n10 & n22; n120 = n12 & n22; n122 = n14 & n22; n124 = (n96 ^ n108) ^ n95; n125 = (n96 & n108) | (n108 & n95) | (n96 & n95); n126 = (n98 ^ n110) ^ n97; n127 = (n98 & n110) | (n110 & n97) | (n98 & n97); n128 = (n100 ^ n112) ^ n99; n129 = (n100 & n112) | (n112 & n99) | (n100 & n99); n130 = (n102 ^ n114) ^ n101; n131 = (n102 & n114) | (n114 & n101) | (n102 & n101); n132 = (n104 ^ n116) ^ n103; n133 = (n104 & n116) | (n116 & n103) | (n104 & n103); n134 = (n106 ^ n118) ^ n105; n135 = (n106 & n118) | (n118 & n105) | (n106 & n105); n136 = (n92 ^ n120) ^ n107; n137 = (n92 & n120) | (n120 & n107) | (n92 & n107); n138 = n0 & n24; n140 = n2 & n24; n142 = n4 & n24; n144 = n6 & n24; n146 = n8 & n24; n148 = n10 & n24; n150 = n12 & n24; n152 = n14 & n24; n154 = (n126 ^ n138) ^ n125; n155 = (n126 & n138) | (n138 & n125) | (n126 & n125); n156 = (n128 ^ n140) ^ n127; n157 = (n128 & n140) | (n140 & n127) | (n128 & n127); n158 = (n130 ^ n142) ^ n129; n159 = (n130 & n142) | (n142 & n129) | (n130 & n129); n160 = (n132 ^ n144) ^ n131; n161 = (n132 & n144) | (n144 & n131) | (n132 & n131); n162 = (n134 ^ n146) ^ n133; n163 = (n134 & n146) | (n146 & n133) | (n134 & n133); n164 = (n136 ^ n148) ^ n135; n165 = (n136 & n148) | (n148 & n135) | (n136 & n135); n166 = (n122 ^ n150) ^ n137; n167 = (n122 & n150) | (n150 & n137) | (n122 & n137); n168 = n0 & n26; n170 = n2 & n26; n172 = n4 & n26; n174 = n6 & n26; n176 = n8 & n26; n178 = n10 & n26; n180 = n12 & n26; n182 = n14 & n26; n184 = (n156 ^ n168) ^ n155; n185 = (n156 & n168) | (n168 & n155) | (n156 & n155); n186 = (n158 ^ n170) ^ n157; n187 = (n158 & n170) | (n170 & n157) | (n158 & n157); n188 = (n160 ^ n172) ^ n159; n189 = (n160 & n172) | (n172 & n159) | (n160 & n159); n190 = (n162 ^ n174) ^ n161; n191 = (n162 & n174) | (n174 & n161) | (n162 & n161); n192 = (n164 ^ n176) ^ n163; n193 = (n164 & n176) | (n176 & n163) | (n164 & n163); n194 = (n166 ^ n178) ^ n165; n195 = (n166 & n178) | (n178 & n165) | (n166 & n165); n196 = (n152 ^ n180) ^ n167; n197 = (n152 & n180) | (n180 & n167) | (n152 & n167); n198 = n0 & n28; n200 = n2 & n28; n202 = n4 & n28; n204 = n6 & n28; n206 = n8 & n28; n208 = n10 & n28; n210 = n12 & n28; n212 = n14 & n28; n214 = (n186 ^ n198) ^ n185; n215 = (n186 & n198) | (n198 & n185) | (n186 & n185); n216 = (n188 ^ n200) ^ n187; n217 = (n188 & n200) | (n200 & n187) | (n188 & n187); n218 = (n190 ^ n202) ^ n189; n219 = (n190 & n202) | (n202 & n189) | (n190 & n189); n220 = (n192 ^ n204) ^ n191; n221 = (n192 & n204) | (n204 & n191) | (n192 & n191); n222 = (n194 ^ n206) ^ n193; n223 = (n194 & n206) | (n206 & n193) | (n194 & n193); n224 = (n196 ^ n208) ^ n195; n225 = (n196 & n208) | (n208 & n195) | (n196 & n195); n226 = (n182 ^ n210) ^ n197; n227 = (n182 & n210) | (n210 & n197) | (n182 & n197); n228 = n0 & n30; n230 = n2 & n30; n232 = n4 & n30; n234 = n6 & n30; n236 = n8 & n30; n238 = n10 & n30; n240 = n12 & n30; n242 = n14 & n30; n244 = (n216 ^ n228) ^ n215; n245 = (n216 & n228) | (n228 & n215) | (n216 & n215); n246 = (n218 ^ n230) ^ n217; n247 = (n218 & n230) | (n230 & n217) | (n218 & n217); n248 = (n220 ^ n232) ^ n219; n249 = (n220 & n232) | (n232 & n219) | (n220 & n219); n250 = (n222 ^ n234) ^ n221; n251 = (n222 & n234) | (n234 & n221) | (n222 & n221); n252 = (n224 ^ n236) ^ n223; n253 = (n224 & n236) | (n236 & n223) | (n224 & n223); n254 = (n226 ^ n238) ^ n225; n255 = (n226 & n238) | (n238 & n225) | (n226 & n225); n256 = (n212 ^ n240) ^ n227; n257 = (n212 & n240) | (n240 & n227) | (n212 & n227); n258 = n246 ^ n245; n259 = n246 & n245; n260 = (n248 ^ n247) ^ n259; n261 = (n248 & n247) | (n247 & n259) | (n248 & n259); n262 = (n250 ^ n249) ^ n261; n263 = (n250 & n249) | (n249 & n261) | (n250 & n261); n264 = (n252 ^ n251) ^ n263; n265 = (n252 & n251) | (n251 & n263) | (n252 & n263); n266 = (n254 ^ n253) ^ n265; n267 = (n254 & n253) | (n253 & n265) | (n254 & n265); n268 = (n256 ^ n255) ^ n267; n269 = (n256 & n255) | (n255 & n267) | (n256 & n267); n270 = (n242 ^ n257) ^ n269; n271 = (n242 & n257) | (n257 & n269) | (n242 & n269); c |= (n32 & 0x1) << 0; c |= (n64 & 0x1) << 1; c |= (n94 & 0x1) << 2; c |= (n124 & 0x1) << 3; c |= (n154 & 0x1) << 4; c |= (n184 & 0x1) << 5; c |= (n214 & 0x1) << 6; c |= (n244 & 0x1) << 7; c |= (n258 & 0x1) << 8; c |= (n260 & 0x1) << 9; c |= (n262 & 0x1) << 10; c |= (n264 & 0x1) << 11; c |= (n266 & 0x1) << 12; c |= (n268 & 0x1) << 13; c |= (n270 & 0x1) << 14; c |= (n271 & 0x1) << 15; return c; }