// ************************************************************************** // // // // eses eses // // eses eses // // eses eseses esesese eses Embedded Systems Group // // ese ese ese ese ese // // ese eseseses eseseses ese Department of Computer Science // // eses eses ese eses // // eses eseses eseseses eses University of Kaiserslautern // // eses eses // // // // ************************************************************************** // [8]nat x; [8]nat y; [16]nat p; thread RadixBMulDadda { nat t0,t1,t10,t100,t101,t102,t103,t104,t105,t106,t107,t108,t109,t11,t110,t111,t112,t113,t114,t115,t116,t117,t118,t119,t12,t120,t121,t122,t123,t124,t125,t126,t127,t128,t129,t13,t130,t131,t132,t133,t134,t135,t136,t137,t138,t139,t14,t140,t141,t142,t143,t144,t145,t146,t147,t148,t149,t15,t150,t151,t152,t153,t154,t155,t156,t157,t158,t159,t16,t160,t161,t162,t163,t164,t165,t166,t167,t168,t169,t17,t170,t171,t172,t173,t174,t175,t176,t177,t178,t179,t18,t180,t181,t182,t183,t184,t185,t186,t187,t188,t189,t19,t190,t191,t192,t193,t194,t195,t196,t197,t198,t199,t2,t20,t200,t201,t202,t203,t204,t205,t206,t207,t208,t209,t21,t210,t211,t212,t213,t214,t215,t216,t217,t218,t219,t22,t220,t221,t222,t223,t224,t225,t226,t227,t228,t229,t23,t230,t231,t232,t233,t234,t235,t236,t237,t238,t239,t24,t240,t241,t242,t243,t244,t245,t246,t247,t248,t249,t25,t250,t251,t252,t253,t254,t255,t256,t257,t258,t259,t26,t260,t261,t262,t263,t264,t265,t266,t267,t268,t269,t27,t270,t271,t272,t273,t274,t275,t276,t277,t278,t279,t28,t280,t281,t282,t283,t284,t285,t286,t287,t288,t289,t29,t290,t291,t292,t293,t294,t295,t296,t297,t298,t299,t3,t30,t300,t301,t302,t303,t304,t305,t306,t307,t308,t309,t31,t310,t311,t312,t313,t314,t315,t316,t317,t318,t319,t32,t320,t321,t322,t323,t324,t325,t326,t327,t328,t329,t33,t330,t331,t332,t333,t334,t335,t336,t337,t338,t339,t34,t340,t341,t342,t343,t344,t345,t346,t347,t348,t349,t35,t350,t351,t352,t353,t354,t355,t356,t357,t358,t359,t36,t360,t361,t362,t363,t364,t365,t366,t367,t368,t369,t37,t370,t371,t372,t373,t374,t375,t376,t377,t378,t379,t38,t380,t381,t382,t383,t384,t385,t386,t387,t388,t389,t39,t390,t391,t392,t393,t394,t395,t396,t397,t398,t399,t4,t40,t400,t401,t402,t403,t404,t405,t406,t407,t408,t409,t41,t410,t411,t412,t413,t414,t415,t416,t417,t418,t419,t42,t420,t421,t422,t423,t424,t425,t426,t427,t428,t429,t43,t430,t431,t432,t433,t434,t435,t436,t437,t438,t439,t44,t440,t441,t442,t443,t444,t445,t446,t447,t448,t449,t45,t450,t451,t452,t453,t454,t455,t456,t457,t458,t459,t46,t460,t461,t462,t463,t464,t465,t466,t467,t468,t469,t47,t470,t471,t472,t473,t474,t475,t476,t477,t478,t479,t48,t480,t481,t482,t483,t484,t485,t486,t487,t488,t489,t49,t490,t491,t492,t493,t494,t495,t496,t497,t498,t499,t5,t50,t500,t501,t502,t503,t504,t505,t506,t507,t508,t509,t51,t510,t511,t512,t513,t514,t515,t516,t517,t518,t519,t52,t520,t521,t522,t523,t524,t525,t526,t527,t528,t529,t53,t530,t531,t532,t533,t534,t535,t536,t537,t538,t539,t54,t540,t55,t56,t57,t58,t59,t6,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t7,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79,t8,t80,t81,t82,t83,t84,t85,t86,t87,t88,t89,t9,t90,t91,t92,t93,t94,t95,t96,t97,t98,t99; bool t541,t542,t543,t544,t545,t546,t547,t548,t549,t550,t551,t552,t553,t554,t555,t556,t557,t558,t559,t560,t561,t562,t563,t564,t565,t566,t567,t568,t569,t570; t0 = x[0]; t1 = x[1]; t2 = x[2]; t3 = x[3]; t4 = x[4]; t5 = x[5]; t6 = x[6]; t7 = x[7]; t8 = y[0]; t9 = y[1]; t10 = y[2]; t11 = y[3]; t12 = y[4]; t13 = y[5]; t14 = y[6]; t15 = y[7]; // compute partial products t16 = t0 * t8; t17 = t16 / 256; t18 = t16 % 256; t19 = t0 * t9; t20 = t19 / 256; t21 = t19 % 256; t22 = t1 * t8; t23 = t22 / 256; t24 = t22 % 256; t25 = t0 * t10; t26 = t25 / 256; t27 = t25 % 256; t28 = t1 * t9; t29 = t28 / 256; t30 = t28 % 256; t31 = t2 * t8; t32 = t31 / 256; t33 = t31 % 256; t34 = t0 * t11; t35 = t34 / 256; t36 = t34 % 256; t37 = t1 * t10; t38 = t37 / 256; t39 = t37 % 256; t40 = t2 * t9; t41 = t40 / 256; t42 = t40 % 256; t43 = t3 * t8; t44 = t43 / 256; t45 = t43 % 256; t46 = t0 * t12; t47 = t46 / 256; t48 = t46 % 256; t49 = t1 * t11; t50 = t49 / 256; t51 = t49 % 256; t52 = t2 * t10; t53 = t52 / 256; t54 = t52 % 256; t55 = t3 * t9; t56 = t55 / 256; t57 = t55 % 256; t58 = t4 * t8; t59 = t58 / 256; t60 = t58 % 256; t61 = t0 * t13; t62 = t61 / 256; t63 = t61 % 256; t64 = t1 * t12; t65 = t64 / 256; t66 = t64 % 256; t67 = t2 * t11; t68 = t67 / 256; t69 = t67 % 256; t70 = t3 * t10; t71 = t70 / 256; t72 = t70 % 256; t73 = t4 * t9; t74 = t73 / 256; t75 = t73 % 256; t76 = t5 * t8; t77 = t76 / 256; t78 = t76 % 256; t79 = t0 * t14; t80 = t79 / 256; t81 = t79 % 256; t82 = t1 * t13; t83 = t82 / 256; t84 = t82 % 256; t85 = t2 * t12; t86 = t85 / 256; t87 = t85 % 256; t88 = t3 * t11; t89 = t88 / 256; t90 = t88 % 256; t91 = t4 * t10; t92 = t91 / 256; t93 = t91 % 256; t94 = t5 * t9; t95 = t94 / 256; t96 = t94 % 256; t97 = t6 * t8; t98 = t97 / 256; t99 = t97 % 256; t100 = t0 * t15; t101 = t100 / 256; t102 = t100 % 256; t103 = t1 * t14; t104 = t103 / 256; t105 = t103 % 256; t106 = t2 * t13; t107 = t106 / 256; t108 = t106 % 256; t109 = t3 * t12; t110 = t109 / 256; t111 = t109 % 256; t112 = t4 * t11; t113 = t112 / 256; t114 = t112 % 256; t115 = t5 * t10; t116 = t115 / 256; t117 = t115 % 256; t118 = t6 * t9; t119 = t118 / 256; t120 = t118 % 256; t121 = t7 * t8; t122 = t121 / 256; t123 = t121 % 256; t124 = t1 * t15; t125 = t124 / 256; t126 = t124 % 256; t127 = t2 * t14; t128 = t127 / 256; t129 = t127 % 256; t130 = t3 * t13; t131 = t130 / 256; t132 = t130 % 256; t133 = t4 * t12; t134 = t133 / 256; t135 = t133 % 256; t136 = t5 * t11; t137 = t136 / 256; t138 = t136 % 256; t139 = t6 * t10; t140 = t139 / 256; t141 = t139 % 256; t142 = t7 * t9; t143 = t142 / 256; t144 = t142 % 256; t145 = t2 * t15; t146 = t145 / 256; t147 = t145 % 256; t148 = t3 * t14; t149 = t148 / 256; t150 = t148 % 256; t151 = t4 * t13; t152 = t151 / 256; t153 = t151 % 256; t154 = t5 * t12; t155 = t154 / 256; t156 = t154 % 256; t157 = t6 * t11; t158 = t157 / 256; t159 = t157 % 256; t160 = t7 * t10; t161 = t160 / 256; t162 = t160 % 256; t163 = t3 * t15; t164 = t163 / 256; t165 = t163 % 256; t166 = t4 * t14; t167 = t166 / 256; t168 = t166 % 256; t169 = t5 * t13; t170 = t169 / 256; t171 = t169 % 256; t172 = t6 * t12; t173 = t172 / 256; t174 = t172 % 256; t175 = t7 * t11; t176 = t175 / 256; t177 = t175 % 256; t178 = t4 * t15; t179 = t178 / 256; t180 = t178 % 256; t181 = t5 * t14; t182 = t181 / 256; t183 = t181 % 256; t184 = t6 * t13; t185 = t184 / 256; t186 = t184 % 256; t187 = t7 * t12; t188 = t187 / 256; t189 = t187 % 256; t190 = t5 * t15; t191 = t190 / 256; t192 = t190 % 256; t193 = t6 * t14; t194 = t193 / 256; t195 = t193 % 256; t196 = t7 * t13; t197 = t196 / 256; t198 = t196 % 256; t199 = t6 * t15; t200 = t199 / 256; t201 = t199 % 256; t202 = t7 * t14; t203 = t202 / 256; t204 = t202 % 256; t205 = t7 * t15; t206 = t205 / 256; t207 = t205 % 256; // reduce heights of each column to 13 t208 = t123 + t120 + t117; t209 = t208 / 256; t210 = t208 % 256; t211 = t135 + t132; t212 = t211 / 256; t213 = t211 % 256; t214 = t144 + t141 + t138; t215 = t214 / 256; t216 = t214 % 256; t217 = t162 + t159 + t156; t218 = t217 / 256; t219 = t217 % 256; // reduce heights of each column to 9 t220 = t78 + t75 + t72; t221 = t220 / 256; t222 = t220 % 256; t223 = t81 + t77; t224 = t223 / 256; t225 = t223 % 256; t226 = t90 + t87 + t84; t227 = t226 / 256; t228 = t226 % 256; t229 = t99 + t96 + t93; t230 = t229 / 256; t231 = t229 % 256; t232 = t86 + t83; t233 = t232 / 256; t234 = t232 % 256; t235 = t95 + t92 + t89; t236 = t235 / 256; t237 = t235 % 256; t238 = t105 + t102 + t98; t239 = t238 / 256; t240 = t238 % 256; t241 = t114 + t111 + t108; t242 = t241 / 256; t243 = t241 % 256; t244 = t101 + t209 + t213; t245 = t244 / 256; t246 = t244 % 256; t247 = t110 + t107 + t104; t248 = t247 / 256; t249 = t247 % 256; t250 = t119 + t116 + t113; t251 = t250 / 256; t252 = t250 % 256; t253 = t129 + t126 + t122; t254 = t253 / 256; t255 = t253 % 256; t256 = t125 + t212 + t215; t257 = t256 / 256; t258 = t256 % 256; t259 = t134 + t131 + t128; t260 = t259 / 256; t261 = t259 % 256; t262 = t143 + t140 + t137; t263 = t262 / 256; t264 = t262 % 256; t265 = t153 + t150 + t147; t266 = t265 / 256; t267 = t265 % 256; t268 = t149 + t146; t269 = t268 / 256; t270 = t268 % 256; t271 = t158 + t155 + t152; t272 = t271 / 256; t273 = t271 % 256; t274 = t168 + t165 + t161; t275 = t274 / 256; t276 = t274 % 256; t277 = t177 + t174 + t171; t278 = t277 / 256; t279 = t277 % 256; t280 = t180 + t176 + t173; t281 = t280 / 256; t282 = t280 % 256; t283 = t189 + t186 + t183; t284 = t283 / 256; t285 = t283 % 256; // reduce heights of each column to 6 t286 = t45 + t42; t287 = t286 / 256; t288 = t286 % 256; t289 = t51 + t48 + t44; t290 = t289 / 256; t291 = t289 % 256; t292 = t60 + t57 + t54; t293 = t292 / 256; t294 = t292 % 256; t295 = t50 + t47; t296 = t295 / 256; t297 = t295 % 256; t298 = t59 + t56 + t53; t299 = t298 / 256; t300 = t298 % 256; t301 = t69 + t66 + t63; t302 = t301 / 256; t303 = t301 % 256; t304 = t225 + t228 + t231; t305 = t304 / 256; t306 = t304 % 256; t307 = t65 + t62 + t221; t308 = t307 / 256; t309 = t307 % 256; t310 = t74 + t71 + t68; t311 = t310 / 256; t312 = t310 % 256; t313 = t237 + t240 + t243; t314 = t313 / 256; t315 = t313 % 256; t316 = t227 + t230 + t234; t317 = t316 / 256; t318 = t316 % 256; t319 = t80 + t210 + t224; t320 = t319 / 256; t321 = t319 % 256; t322 = t249 + t252 + t255; t323 = t322 / 256; t324 = t322 % 256; t325 = t239 + t242 + t246; t326 = t325 / 256; t327 = t325 % 256; t328 = t216 + t233 + t236; t329 = t328 / 256; t330 = t328 % 256; t331 = t261 + t264 + t267; t332 = t331 / 256; t333 = t331 % 256; t334 = t251 + t254 + t258; t335 = t334 / 256; t336 = t334 % 256; t337 = t219 + t245 + t248; t338 = t337 / 256; t339 = t337 % 256; t340 = t273 + t276 + t279; t341 = t340 / 256; t342 = t340 % 256; t343 = t263 + t266 + t270; t344 = t343 / 256; t345 = t343 % 256; t346 = t218 + t257 + t260; t347 = t346 / 256; t348 = t346 % 256; t349 = t278 + t282 + t285; t350 = t349 / 256; t351 = t349 % 256; t352 = t269 + t272 + t275; t353 = t352 / 256; t354 = t352 % 256; t355 = t170 + t167 + t164; t356 = t355 / 256; t357 = t355 % 256; t358 = t179 + t281 + t284; t359 = t358 / 256; t360 = t358 % 256; t361 = t188 + t185 + t182; t362 = t361 / 256; t363 = t361 % 256; t364 = t198 + t195 + t192; t365 = t364 / 256; t366 = t364 % 256; t367 = t204 + t201 + t197; t368 = t367 / 256; t369 = t367 % 256; // reduce heights of each column to 4 t370 = t33 + t30; t371 = t370 / 256; t372 = t370 % 256; t373 = t29 + t26; t374 = t373 / 256; t375 = t373 % 256; t376 = t39 + t36 + t32; t377 = t376 / 256; t378 = t376 % 256; t379 = t287 + t291 + t294; t380 = t379 / 256; t381 = t379 % 256; t382 = t41 + t38 + t35; t383 = t382 / 256; t384 = t382 % 256; t385 = t297 + t300 + t303; t386 = t385 / 256; t387 = t385 % 256; t388 = t222 + t290 + t293; t389 = t388 / 256; t390 = t388 % 256; t391 = t306 + t309 + t312; t392 = t391 / 256; t393 = t391 % 256; t394 = t296 + t299 + t302; t395 = t394 / 256; t396 = t394 % 256; t397 = t315 + t318 + t321; t398 = t397 / 256; t399 = t397 % 256; t400 = t305 + t308 + t311; t401 = t400 / 256; t402 = t400 % 256; t403 = t324 + t327 + t330; t404 = t403 / 256; t405 = t403 % 256; t406 = t314 + t317 + t320; t407 = t406 / 256; t408 = t406 % 256; t409 = t333 + t336 + t339; t410 = t409 / 256; t411 = t409 % 256; t412 = t323 + t326 + t329; t413 = t412 / 256; t414 = t412 % 256; t415 = t342 + t345 + t348; t416 = t415 / 256; t417 = t415 % 256; t418 = t332 + t335 + t338; t419 = t418 / 256; t420 = t418 % 256; t421 = t351 + t354 + t357; t422 = t421 / 256; t423 = t421 % 256; t424 = t341 + t344 + t347; t425 = t424 / 256; t426 = t424 % 256; t427 = t360 + t363 + t366; t428 = t427 / 256; t429 = t427 % 256; t430 = t350 + t353 + t356; t431 = t430 / 256; t432 = t430 % 256; t433 = t362 + t365 + t369; t434 = t433 / 256; t435 = t433 % 256; t436 = t194 + t191 + t359; t437 = t436 / 256; t438 = t436 % 256; t439 = t207 + t203 + t200; t440 = t439 / 256; t441 = t439 % 256; // reduce heights of each column to 3 t442 = t27 + t23; t443 = t442 / 256; t444 = t442 % 256; t445 = t288 + t371 + t375; t446 = t445 / 256; t447 = t445 % 256; t448 = t374 + t377 + t381; t449 = t448 / 256; t450 = t448 % 256; t451 = t380 + t383 + t387; t452 = t451 / 256; t453 = t451 % 256; t454 = t386 + t389 + t393; t455 = t454 / 256; t456 = t454 % 256; t457 = t392 + t395 + t399; t458 = t457 / 256; t459 = t457 % 256; t460 = t398 + t401 + t405; t461 = t460 / 256; t462 = t460 % 256; t463 = t404 + t407 + t411; t464 = t463 / 256; t465 = t463 % 256; t466 = t410 + t413 + t417; t467 = t466 / 256; t468 = t466 % 256; t469 = t416 + t419 + t423; t470 = t469 / 256; t471 = t469 % 256; t472 = t422 + t425 + t429; t473 = t472 / 256; t474 = t472 % 256; t475 = t428 + t431 + t435; t476 = t475 / 256; t477 = t475 % 256; t478 = t368 + t434 + t437; t479 = t478 / 256; t480 = t478 % 256; // reduce heights of each column to 2 t481 = t24 + t21; t482 = t481 / 256; t483 = t481 % 256; t484 = t20 + t372 + t444; t485 = t484 / 256; t486 = t484 % 256; t487 = t378 + t443 + t447; t488 = t487 / 256; t489 = t487 % 256; t490 = t384 + t446 + t450; t491 = t490 / 256; t492 = t490 % 256; t493 = t390 + t449 + t453; t494 = t493 / 256; t495 = t493 % 256; t496 = t396 + t452 + t456; t497 = t496 / 256; t498 = t496 % 256; t499 = t402 + t455 + t459; t500 = t499 / 256; t501 = t499 % 256; t502 = t408 + t458 + t462; t503 = t502 / 256; t504 = t502 % 256; t505 = t414 + t461 + t465; t506 = t505 / 256; t507 = t505 % 256; t508 = t420 + t464 + t468; t509 = t508 / 256; t510 = t508 % 256; t511 = t426 + t467 + t471; t512 = t511 / 256; t513 = t511 % 256; t514 = t432 + t470 + t474; t515 = t514 / 256; t516 = t514 % 256; t517 = t438 + t473 + t477; t518 = t517 / 256; t519 = t517 % 256; t520 = t441 + t476 + t480; t521 = t520 / 256; t522 = t520 % 256; t523 = t206 + t440 + t479; t524 = t523 / 256; t525 = t523 % 256; // preliminary addition of the two remaining numbers t526 = t17 + t483; t527 = t482 + t486; t528 = t485 + t489; t529 = t488 + t492; t530 = t491 + t495; t531 = t494 + t498; t532 = t497 + t501; t533 = t500 + t504; t534 = t503 + t507; t535 = t506 + t510; t536 = t509 + t513; t537 = t512 + t516; t538 = t515 + t519; t539 = t518 + t522; t540 = t521 + t525; // compute generate and propagate pairs t541 = t526 > 255; t542 = t526 == 255; t543 = t527 > 255; t544 = t527 == 255; t545 = t528 > 255; t546 = t528 == 255; t547 = t529 > 255; t548 = t529 == 255; t549 = t530 > 255; t550 = t530 == 255; t551 = t531 > 255; t552 = t531 == 255; t553 = t532 > 255; t554 = t532 == 255; t555 = t533 > 255; t556 = t533 == 255; t557 = t534 > 255; t558 = t534 == 255; t559 = t535 > 255; t560 = t535 == 255; t561 = t536 > 255; t562 = t536 == 255; t563 = t537 > 255; t564 = t537 == 255; t565 = t538 > 255; t566 = t538 == 255; t567 = t539 > 255; t568 = t539 == 255; t569 = t540 > 255; t570 = t540 == 255; // parallel prefix tree for computing carry bits // up-level 1 t543 = t544 & t541 | t543; t544 = t544 & t542; t547 = t548 & t545 | t547; t548 = t548 & t546; t551 = t552 & t549 | t551; t552 = t552 & t550; t555 = t556 & t553 | t555; t556 = t556 & t554; t559 = t560 & t557 | t559; t560 = t560 & t558; t563 = t564 & t561 | t563; t564 = t564 & t562; t567 = t568 & t565 | t567; t568 = t568 & t566; // up-level 2 t547 = t548 & t543 | t547; t548 = t548 & t544; t555 = t556 & t551 | t555; t556 = t556 & t552; t563 = t564 & t559 | t563; t564 = t564 & t560; // up-level 3 t555 = t556 & t547 | t555; t556 = t556 & t548; // down-level 5 t563 = t564 & t555 | t563; t564 = t564 & t556; // down-level 6 t567 = t568 & t563 | t567; t568 = t568 & t564; t551 = t552 & t547 | t551; t552 = t552 & t548; t567 = t568 & t563 | t567; t568 = t568 & t564; t559 = t560 & t555 | t559; t560 = t560 & t556; t567 = t568 & t563 | t567; t568 = t568 & t564; // down-level 7 t569 = t570 & t559 | t569; t570 = t570 & t560; t545 = t546 & t543 | t545; t546 = t546 & t544; t569 = t570 & t559 | t569; t570 = t570 & t560; t549 = t550 & t547 | t549; t550 = t550 & t548; t569 = t570 & t559 | t569; t570 = t570 & t560; t553 = t554 & t567 | t553; t554 = t554 & t568; t569 = t570 & t559 | t569; t570 = t570 & t560; t557 = t558 & t551 | t557; t558 = t558 & t552; t569 = t570 & t559 | t569; t570 = t570 & t560; t561 = t562 & t555 | t561; t562 = t562 & t556; t569 = t570 & t559 | t569; t570 = t570 & t560; t565 = t566 & t567 | t565; t566 = t566 & t568; t569 = t570 & t559 | t569; t570 = t570 & t560; // compute final sum digits as the digits of the product t540 = t540+(t567?1:0); t539 = t539+(t565?1:0); t538 = t538+(t563?1:0); t537 = t537+(t561?1:0); t536 = t536+(t559?1:0); t535 = t535+(t557?1:0); t534 = t534+(t555?1:0); t533 = t533+(t553?1:0); t532 = t532+(t551?1:0); t531 = t531+(t549?1:0); t530 = t530+(t547?1:0); t529 = t529+(t545?1:0); t528 = t528+(t543?1:0); t527 = t527+(t541?1:0); // get the product digits p[0] = t18; p[1] = t526 % 256; p[2] = t527 % 256; p[3] = t528 % 256; p[4] = t529 % 256; p[5] = t530 % 256; p[6] = t531 % 256; p[7] = t532 % 256; p[8] = t533 % 256; p[9] = t534 % 256; p[10] = t535 % 256; p[11] = t536 % 256; p[12] = t537 % 256; p[13] = t538 % 256; p[14] = t539 % 256; p[15] = t540 % 256; }