stzoffseti.v 22.4 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429

/**************************************************************************
 *                                                                        *
 *               Copyright (C) 1994, Silicon Graphics, Inc.               *
 *                                                                        *
 *  These coded instructions, statements, and computer programs  contain  *
 *  unpublished  proprietary  information of Silicon Graphics, Inc., and  *
 *  are protected by Federal copyright  law.  They  may not be disclosed  *
 *  to  third  parties  or copied or duplicated in any form, in whole or  *
 *  in part, without the prior written consent of Silicon Graphics, Inc.  *
 *                                                                        *
 *************************************************************************/
// $Id: stzoffseti.v,v 1.1.1.1 2002/05/17 06:07:48 blythe Exp $
/*      Project Reality
        MDP
        Created by Mike M. Cai  9/17/94
*/

module stzoffseti( att_data_out,
                  att_data_in, dx, x_offset, 
                  dy, y_offset);
output [18:0]   att_data_out;  // integer only
input [21:0]   att_data_in;   // 14 bits integer, 4 bits fraction
input [21:0]   dx, dy;        // 14 bits integer, 4 bits fraction
input[1:0]     x_offset, y_offset;  // 2 bits of fractions

wire [21:0]    x_prod0, y_prod0;
wire [22:0]    x_prod1, y_prod1;
wire [23:0]    add_prod1_s, add_prod1_co;
wire [23:0]    add_prod2_s, add_prod2_co;
wire [23:0]    add_prod3_s, add_prod3_co;
wire [23:0]    sum0, sum0_co, sum1, sum1_co;
wire [23:0]    sum;          
wire [18:0]    att_data_out;

an02d1
// x_prod0
x_prod0_0(.z(x_prod0[0]), .a1(dx[0]), .a2(x_offset[0])),
x_prod0_1(.z(x_prod0[1]), .a1(dx[1]), .a2(x_offset[0])),
x_prod0_2(.z(x_prod0[2]), .a1(dx[2]), .a2(x_offset[0])),
x_prod0_3(.z(x_prod0[3]), .a1(dx[3]), .a2(x_offset[0])),
x_prod0_4(.z(x_prod0[4]), .a1(dx[4]), .a2(x_offset[0])),
x_prod0_5(.z(x_prod0[5]), .a1(dx[5]), .a2(x_offset[0])),
x_prod0_6(.z(x_prod0[6]), .a1(dx[6]), .a2(x_offset[0])),
x_prod0_7(.z(x_prod0[7]), .a1(dx[7]), .a2(x_offset[0])),
x_prod0_8(.z(x_prod0[8]), .a1(dx[8]), .a2(x_offset[0])),
x_prod0_9(.z(x_prod0[9]), .a1(dx[9]), .a2(x_offset[0])),
x_prod0_10(.z(x_prod0[10]), .a1(dx[10]), .a2(x_offset[0])),
x_prod0_11(.z(x_prod0[11]), .a1(dx[11]), .a2(x_offset[0])),
x_prod0_12(.z(x_prod0[12]), .a1(dx[12]), .a2(x_offset[0])),
x_prod0_13(.z(x_prod0[13]), .a1(dx[13]), .a2(x_offset[0])),
x_prod0_14(.z(x_prod0[14]), .a1(dx[14]), .a2(x_offset[0])),
x_prod0_15(.z(x_prod0[15]), .a1(dx[15]), .a2(x_offset[0])),
x_prod0_16(.z(x_prod0[16]), .a1(dx[16]), .a2(x_offset[0])),
x_prod0_17(.z(x_prod0[17]), .a1(dx[17]), .a2(x_offset[0])),
x_prod0_18(.z(x_prod0[18]), .a1(dx[18]), .a2(x_offset[0])),
x_prod0_19(.z(x_prod0[19]), .a1(dx[19]), .a2(x_offset[0])),
x_prod0_20(.z(x_prod0[20]), .a1(dx[20]), .a2(x_offset[0])),
x_prod0_21(.z(x_prod0[21]), .a1(dx[21]), .a2(x_offset[0])),
// x_prod0_22(.z(x_prod0[22]), .a1(dx[22]), .a2(x_offset[0])),
// x_prod0_23(.z(x_prod0[23]), .a1(dx[23]), .a2(x_offset[0])),
// x_prod1
x_prod1_1(.z(x_prod1[1]), .a1(dx[0]), .a2(x_offset[1])),
x_prod1_2(.z(x_prod1[2]), .a1(dx[1]), .a2(x_offset[1])),
x_prod1_3(.z(x_prod1[3]), .a1(dx[2]), .a2(x_offset[1])),
x_prod1_4(.z(x_prod1[4]), .a1(dx[3]), .a2(x_offset[1])),
x_prod1_5(.z(x_prod1[5]), .a1(dx[4]), .a2(x_offset[1])),
x_prod1_6(.z(x_prod1[6]), .a1(dx[5]), .a2(x_offset[1])),
x_prod1_7(.z(x_prod1[7]), .a1(dx[6]), .a2(x_offset[1])),
x_prod1_8(.z(x_prod1[8]), .a1(dx[7]), .a2(x_offset[1])),
x_prod1_9(.z(x_prod1[9]), .a1(dx[8]), .a2(x_offset[1])),
x_prod1_10(.z(x_prod1[10]), .a1(dx[9]), .a2(x_offset[1])),
x_prod1_11(.z(x_prod1[11]), .a1(dx[10]), .a2(x_offset[1])),
x_prod1_12(.z(x_prod1[12]), .a1(dx[11]), .a2(x_offset[1])),
x_prod1_13(.z(x_prod1[13]), .a1(dx[12]), .a2(x_offset[1])),
x_prod1_14(.z(x_prod1[14]), .a1(dx[13]), .a2(x_offset[1])),
x_prod1_15(.z(x_prod1[15]), .a1(dx[14]), .a2(x_offset[1])),
x_prod1_16(.z(x_prod1[16]), .a1(dx[15]), .a2(x_offset[1])),
x_prod1_17(.z(x_prod1[17]), .a1(dx[16]), .a2(x_offset[1])),
x_prod1_18(.z(x_prod1[18]), .a1(dx[17]), .a2(x_offset[1])),
x_prod1_19(.z(x_prod1[19]), .a1(dx[18]), .a2(x_offset[1])),
x_prod1_20(.z(x_prod1[20]), .a1(dx[19]), .a2(x_offset[1])),
x_prod1_21(.z(x_prod1[21]), .a1(dx[20]), .a2(x_offset[1])),
x_prod1_22(.z(x_prod1[22]), .a1(dx[21]), .a2(x_offset[1])),
// x_prod1_23(.z(x_prod1[23]), .a1(dx[22]), .a2(x_offset[1])),
// y_prod0
y_prod0_0(.z(y_prod0[0]), .a1(dy[0]), .a2(y_offset[0])),
y_prod0_1(.z(y_prod0[1]), .a1(dy[1]), .a2(y_offset[0])),
y_prod0_2(.z(y_prod0[2]), .a1(dy[2]), .a2(y_offset[0])),
y_prod0_3(.z(y_prod0[3]), .a1(dy[3]), .a2(y_offset[0])),
y_prod0_4(.z(y_prod0[4]), .a1(dy[4]), .a2(y_offset[0])),
y_prod0_5(.z(y_prod0[5]), .a1(dy[5]), .a2(y_offset[0])),
y_prod0_6(.z(y_prod0[6]), .a1(dy[6]), .a2(y_offset[0])),
y_prod0_7(.z(y_prod0[7]), .a1(dy[7]), .a2(y_offset[0])),
y_prod0_8(.z(y_prod0[8]), .a1(dy[8]), .a2(y_offset[0])),
y_prod0_9(.z(y_prod0[9]), .a1(dy[9]), .a2(y_offset[0])),
y_prod0_10(.z(y_prod0[10]), .a1(dy[10]), .a2(y_offset[0])),
y_prod0_11(.z(y_prod0[11]), .a1(dy[11]), .a2(y_offset[0])),
y_prod0_12(.z(y_prod0[12]), .a1(dy[12]), .a2(y_offset[0])),
y_prod0_13(.z(y_prod0[13]), .a1(dy[13]), .a2(y_offset[0])),
y_prod0_14(.z(y_prod0[14]), .a1(dy[14]), .a2(y_offset[0])),
y_prod0_15(.z(y_prod0[15]), .a1(dy[15]), .a2(y_offset[0])),
y_prod0_16(.z(y_prod0[16]), .a1(dy[16]), .a2(y_offset[0])),
y_prod0_17(.z(y_prod0[17]), .a1(dy[17]), .a2(y_offset[0])),
y_prod0_18(.z(y_prod0[18]), .a1(dy[18]), .a2(y_offset[0])),
y_prod0_19(.z(y_prod0[19]), .a1(dy[19]), .a2(y_offset[0])),
y_prod0_20(.z(y_prod0[20]), .a1(dy[20]), .a2(y_offset[0])),
y_prod0_21(.z(y_prod0[21]), .a1(dy[21]), .a2(y_offset[0])),
// y_prod0_22(.z(y_prod0[22]), .a1(dy[22]), .a2(y_offset[0])),
// y_prod0_23(.z(y_prod0[23]), .a1(dy[23]), .a2(y_offset[0])),
// y_prod1
y_prod1_1(.z(y_prod1[1]), .a1(dy[0]), .a2(y_offset[1])),
y_prod1_2(.z(y_prod1[2]), .a1(dy[1]), .a2(y_offset[1])),
y_prod1_3(.z(y_prod1[3]), .a1(dy[2]), .a2(y_offset[1])),
y_prod1_4(.z(y_prod1[4]), .a1(dy[3]), .a2(y_offset[1])),
y_prod1_5(.z(y_prod1[5]), .a1(dy[4]), .a2(y_offset[1])),
y_prod1_6(.z(y_prod1[6]), .a1(dy[5]), .a2(y_offset[1])),
y_prod1_7(.z(y_prod1[7]), .a1(dy[6]), .a2(y_offset[1])),
y_prod1_8(.z(y_prod1[8]), .a1(dy[7]), .a2(y_offset[1])),
y_prod1_9(.z(y_prod1[9]), .a1(dy[8]), .a2(y_offset[1])),
y_prod1_10(.z(y_prod1[10]), .a1(dy[9]), .a2(y_offset[1])),
y_prod1_11(.z(y_prod1[11]), .a1(dy[10]), .a2(y_offset[1])),
y_prod1_12(.z(y_prod1[12]), .a1(dy[11]), .a2(y_offset[1])),
y_prod1_13(.z(y_prod1[13]), .a1(dy[12]), .a2(y_offset[1])),
y_prod1_14(.z(y_prod1[14]), .a1(dy[13]), .a2(y_offset[1])),
y_prod1_15(.z(y_prod1[15]), .a1(dy[14]), .a2(y_offset[1])),
y_prod1_16(.z(y_prod1[16]), .a1(dy[15]), .a2(y_offset[1])),
y_prod1_17(.z(y_prod1[17]), .a1(dy[16]), .a2(y_offset[1])),
y_prod1_18(.z(y_prod1[18]), .a1(dy[17]), .a2(y_offset[1])),
y_prod1_19(.z(y_prod1[19]), .a1(dy[18]), .a2(y_offset[1])),
y_prod1_20(.z(y_prod1[20]), .a1(dy[19]), .a2(y_offset[1])),
y_prod1_21(.z(y_prod1[21]), .a1(dy[20]), .a2(y_offset[1])),
y_prod1_22(.z(y_prod1[22]), .a1(dy[21]), .a2(y_offset[1]));
// y_prod1_23(.z(y_prod1[23]), .a1(dy[22]), .a2(y_offset[1])),


// y_prod1_23(.z(y_prod1[22]), .a1(dy[22]), .a2(y_offset[1]));

// Wallace tree adders
// Stage 1
ad01d1
add_prod1_0(.s(add_prod1_s[0]), .co(add_prod1_co[1]),
        .a(x_prod0[0]), .b(1'h0), .ci(y_prod0[0])),
add_prod1_1(.s(add_prod1_s[1]), .co(add_prod1_co[2]),
        .a(x_prod0[1]), .b(x_prod1[1]), .ci(y_prod0[1])),
add_prod1_2(.s(add_prod1_s[2]), .co(add_prod1_co[3]),
        .a(x_prod0[2]), .b(x_prod1[2]), .ci(y_prod0[2])),
add_prod1_3(.s(add_prod1_s[3]), .co(add_prod1_co[4]),
        .a(x_prod0[3]), .b(x_prod1[3]), .ci(y_prod0[3])),
add_prod1_4(.s(add_prod1_s[4]), .co(add_prod1_co[5]),
        .a(x_prod0[4]), .b(x_prod1[4]), .ci(y_prod0[4])),
add_prod1_5(.s(add_prod1_s[5]), .co(add_prod1_co[6]),
        .a(x_prod0[5]), .b(x_prod1[5]), .ci(y_prod0[5])),
add_prod1_6(.s(add_prod1_s[6]), .co(add_prod1_co[7]),
        .a(x_prod0[6]), .b(x_prod1[6]), .ci(y_prod0[6])),
add_prod1_7(.s(add_prod1_s[7]), .co(add_prod1_co[8]),
        .a(x_prod0[7]), .b(x_prod1[7]), .ci(y_prod0[7])),
add_prod1_8(.s(add_prod1_s[8]), .co(add_prod1_co[9]),
        .a(x_prod0[8]), .b(x_prod1[8]), .ci(y_prod0[8])),
add_prod1_9(.s(add_prod1_s[9]), .co(add_prod1_co[10]),
        .a(x_prod0[9]), .b(x_prod1[9]), .ci(y_prod0[9])),
add_prod1_10(.s(add_prod1_s[10]), .co(add_prod1_co[11]),
        .a(x_prod0[10]), .b(x_prod1[10]), .ci(y_prod0[10])),
add_prod1_11(.s(add_prod1_s[11]), .co(add_prod1_co[12]),
        .a(x_prod0[11]), .b(x_prod1[11]), .ci(y_prod0[11])),
add_prod1_12(.s(add_prod1_s[12]), .co(add_prod1_co[13]),
        .a(x_prod0[12]), .b(x_prod1[12]), .ci(y_prod0[12])),
add_prod1_13(.s(add_prod1_s[13]), .co(add_prod1_co[14]),
        .a(x_prod0[13]), .b(x_prod1[13]), .ci(y_prod0[13])),
add_prod1_14(.s(add_prod1_s[14]), .co(add_prod1_co[15]),
        .a(x_prod0[14]), .b(x_prod1[14]), .ci(y_prod0[14])),
add_prod1_15(.s(add_prod1_s[15]), .co(add_prod1_co[16]),
        .a(x_prod0[15]), .b(x_prod1[15]), .ci(y_prod0[15])),
add_prod1_16(.s(add_prod1_s[16]), .co(add_prod1_co[17]),
        .a(x_prod0[16]), .b(x_prod1[16]), .ci(y_prod0[16])),
add_prod1_17(.s(add_prod1_s[17]), .co(add_prod1_co[18]),
        .a(x_prod0[17]), .b(x_prod1[17]), .ci(y_prod0[17])),
add_prod1_18(.s(add_prod1_s[18]), .co(add_prod1_co[19]),
        .a(x_prod0[18]), .b(x_prod1[18]), .ci(y_prod0[18])),
add_prod1_19(.s(add_prod1_s[19]), .co(add_prod1_co[20]),
        .a(x_prod0[19]), .b(x_prod1[19]), .ci(y_prod0[19])),
add_prod1_20(.s(add_prod1_s[20]), .co(add_prod1_co[21]),
        .a(x_prod0[20]), .b(x_prod1[20]), .ci(y_prod0[20])),
add_prod1_21(.s(add_prod1_s[21]), .co(add_prod1_co[22]),
        .a(x_prod0[21]), .b(x_prod1[21]), .ci(y_prod0[21])),
add_prod1_22(.s(add_prod1_s[22]), .co(add_prod1_co[23]),
        .a(x_prod0[21]), .b(x_prod1[22]), .ci(y_prod0[21])),
add_prod1_23(.s(add_prod1_s[23]), //.co(add_prod1_co[24]),
        .a(x_prod0[21]), .b(x_prod1[22]), .ci(y_prod0[21])),
// stage 2
// add_prod2_0(.s(add_prod2_s[0]), .co(add_prod2_co[1]), 
//        .a(1'h0), .b(1'h0), .ci(add_prod1_co[0])),
add_prod2_1(.s(add_prod2_s[1]), .co(add_prod2_co[2]), 
        .a(1'h0), .b(y_prod1[1]), .ci(add_prod1_co[1])),
add_prod2_2(.s(add_prod2_s[2]), .co(add_prod2_co[3]), 
        .a(att_data_in[0]), .b(y_prod1[2]), .ci(add_prod1_co[2])),
add_prod2_3(.s(add_prod2_s[3]), .co(add_prod2_co[4]), 
        .a(att_data_in[1]), .b(y_prod1[3]), .ci(add_prod1_co[3])),
add_prod2_4(.s(add_prod2_s[4]), .co(add_prod2_co[5]), 
        .a(att_data_in[2]), .b(y_prod1[4]), .ci(add_prod1_co[4])),
add_prod2_5(.s(add_prod2_s[5]), .co(add_prod2_co[6]), 
        .a(att_data_in[3]), .b(y_prod1[5]), .ci(add_prod1_co[5])),
add_prod2_6(.s(add_prod2_s[6]), .co(add_prod2_co[7]), 
        .a(att_data_in[4]), .b(y_prod1[6]), .ci(add_prod1_co[6])),
add_prod2_7(.s(add_prod2_s[7]), .co(add_prod2_co[8]), 
        .a(att_data_in[5]), .b(y_prod1[7]), .ci(add_prod1_co[7])),
add_prod2_8(.s(add_prod2_s[8]), .co(add_prod2_co[9]), 
        .a(att_data_in[6]), .b(y_prod1[8]), .ci(add_prod1_co[8])),
add_prod2_9(.s(add_prod2_s[9]), .co(add_prod2_co[10]), 
        .a(att_data_in[7]), .b(y_prod1[9]), .ci(add_prod1_co[9])),
add_prod2_10(.s(add_prod2_s[10]), .co(add_prod2_co[11]), 
        .a(att_data_in[8]), .b(y_prod1[10]), .ci(add_prod1_co[10])),
add_prod2_11(.s(add_prod2_s[11]), .co(add_prod2_co[12]), 
        .a(att_data_in[9]), .b(y_prod1[11]), .ci(add_prod1_co[11])),
add_prod2_12(.s(add_prod2_s[12]), .co(add_prod2_co[13]), 
        .a(att_data_in[10]), .b(y_prod1[12]), .ci(add_prod1_co[12])),
add_prod2_13(.s(add_prod2_s[13]), .co(add_prod2_co[14]), 
        .a(att_data_in[11]), .b(y_prod1[13]), .ci(add_prod1_co[13])),
add_prod2_14(.s(add_prod2_s[14]), .co(add_prod2_co[15]), 
        .a(att_data_in[12]), .b(y_prod1[14]), .ci(add_prod1_co[14])),
add_prod2_15(.s(add_prod2_s[15]), .co(add_prod2_co[16]), 
        .a(att_data_in[13]), .b(y_prod1[15]), .ci(add_prod1_co[15])),
add_prod2_16(.s(add_prod2_s[16]), .co(add_prod2_co[17]), 
        .a(att_data_in[14]), .b(y_prod1[16]), .ci(add_prod1_co[16])),
add_prod2_17(.s(add_prod2_s[17]), .co(add_prod2_co[18]), 
        .a(att_data_in[15]), .b(y_prod1[17]), .ci(add_prod1_co[17])),
add_prod2_18(.s(add_prod2_s[18]), .co(add_prod2_co[19]), 
        .a(att_data_in[16]), .b(y_prod1[18]), .ci(add_prod1_co[18])),
add_prod2_19(.s(add_prod2_s[19]), .co(add_prod2_co[20]), 
        .a(att_data_in[17]), .b(y_prod1[19]), .ci(add_prod1_co[19])),
add_prod2_20(.s(add_prod2_s[20]), .co(add_prod2_co[21]), 
        .a(att_data_in[18]), .b(y_prod1[20]), .ci(add_prod1_co[20])),
add_prod2_21(.s(add_prod2_s[21]), .co(add_prod2_co[22]), 
        .a(att_data_in[19]), .b(y_prod1[21]), .ci(add_prod1_co[21])),
add_prod2_22(.s(add_prod2_s[22]), .co(add_prod2_co[23]), 
        .a(att_data_in[20]), .b(y_prod1[22]), .ci(add_prod1_co[22])),
add_prod2_23(.s(add_prod2_s[23]), // .co(add_prod2_co[24]), 
        .a(att_data_in[21]), .b(y_prod1[22]), .ci(add_prod1_co[23]));
// stage 3
// add_prod3_0(.s(add_prod3_s[0]), .co(add_prod3_co[1]), 
//        .a(add_prod2_co[0]), .b(add_prod1_s[0]), .ci(add_prod2_s[0])),
assign  add_prod3_s[0] = add_prod1_s[0];
assign  add_prod3_co[1] = 1'h0;

ad01d1
add_prod3_1(.s(add_prod3_s[1]), .co(add_prod3_co[2]), 
        .a(1'h0), .b(add_prod1_s[1]), .ci(add_prod2_s[1])),
add_prod3_2(.s(add_prod3_s[2]), .co(add_prod3_co[3]), 
        .a(add_prod2_co[2]), .b(add_prod1_s[2]), .ci(add_prod2_s[2])),
add_prod3_3(.s(add_prod3_s[3]), .co(add_prod3_co[4]), 
        .a(add_prod2_co[3]), .b(add_prod1_s[3]), .ci(add_prod2_s[3])),
add_prod3_4(.s(add_prod3_s[4]), .co(add_prod3_co[5]), 
        .a(add_prod2_co[4]), .b(add_prod1_s[4]), .ci(add_prod2_s[4])),
add_prod3_5(.s(add_prod3_s[5]), .co(add_prod3_co[6]), 
        .a(add_prod2_co[5]), .b(add_prod1_s[5]), .ci(add_prod2_s[5])),
add_prod3_6(.s(add_prod3_s[6]), .co(add_prod3_co[7]), 
        .a(add_prod2_co[6]), .b(add_prod1_s[6]), .ci(add_prod2_s[6])),
add_prod3_7(.s(add_prod3_s[7]), .co(add_prod3_co[8]), 
        .a(add_prod2_co[7]), .b(add_prod1_s[7]), .ci(add_prod2_s[7])),
add_prod3_8(.s(add_prod3_s[8]), .co(add_prod3_co[9]), 
        .a(add_prod2_co[8]), .b(add_prod1_s[8]), .ci(add_prod2_s[8])),
add_prod3_9(.s(add_prod3_s[9]), .co(add_prod3_co[10]), 
        .a(add_prod2_co[9]), .b(add_prod1_s[9]), .ci(add_prod2_s[9])),
add_prod3_10(.s(add_prod3_s[10]), .co(add_prod3_co[11]), 
        .a(add_prod2_co[10]), .b(add_prod1_s[10]), .ci(add_prod2_s[10])),
add_prod3_11(.s(add_prod3_s[11]), .co(add_prod3_co[12]), 
        .a(add_prod2_co[11]), .b(add_prod1_s[11]), .ci(add_prod2_s[11])),
add_prod3_12(.s(add_prod3_s[12]), .co(add_prod3_co[13]), 
        .a(add_prod2_co[12]), .b(add_prod1_s[12]), .ci(add_prod2_s[12])),
add_prod3_13(.s(add_prod3_s[13]), .co(add_prod3_co[14]), 
        .a(add_prod2_co[13]), .b(add_prod1_s[13]), .ci(add_prod2_s[13])),
add_prod3_14(.s(add_prod3_s[14]), .co(add_prod3_co[15]), 
        .a(add_prod2_co[14]), .b(add_prod1_s[14]), .ci(add_prod2_s[14])),
add_prod3_15(.s(add_prod3_s[15]), .co(add_prod3_co[16]), 
        .a(add_prod2_co[15]), .b(add_prod1_s[15]), .ci(add_prod2_s[15])),
add_prod3_16(.s(add_prod3_s[16]), .co(add_prod3_co[17]), 
        .a(add_prod2_co[16]), .b(add_prod1_s[16]), .ci(add_prod2_s[16])),
add_prod3_17(.s(add_prod3_s[17]), .co(add_prod3_co[18]), 
        .a(add_prod2_co[17]), .b(add_prod1_s[17]), .ci(add_prod2_s[17])),
add_prod3_18(.s(add_prod3_s[18]), .co(add_prod3_co[19]), 
        .a(add_prod2_co[18]), .b(add_prod1_s[18]), .ci(add_prod2_s[18])),
add_prod3_19(.s(add_prod3_s[19]), .co(add_prod3_co[20]), 
        .a(add_prod2_co[19]), .b(add_prod1_s[19]), .ci(add_prod2_s[19])),
add_prod3_20(.s(add_prod3_s[20]), .co(add_prod3_co[21]), 
        .a(add_prod2_co[20]), .b(add_prod1_s[20]), .ci(add_prod2_s[20])),
add_prod3_21(.s(add_prod3_s[21]), .co(add_prod3_co[22]), 
        .a(add_prod2_co[21]), .b(add_prod1_s[21]), .ci(add_prod2_s[21])),
add_prod3_22(.s(add_prod3_s[22]), .co(add_prod3_co[23]), 
        .a(add_prod2_co[22]), .b(add_prod1_s[22]), .ci(add_prod2_s[22])),
add_prod3_23(.s(add_prod3_s[23]), // .co(add_prod3_co[24]), 
        .a(add_prod2_co[23]), .b(add_prod1_s[23]), .ci(add_prod2_s[23]));

assign  sum[0] = add_prod3_s[0];
assign  sum[1] = add_prod3_s[1];

ad01d1
   sum2(.s(sum[2]), .co(sum0_co[3]),
      	 .a(add_prod3_s[2]), .b(add_prod3_co[2]), .ci(1'h0)),
   sum3(.s(sum[3]), .co(sum0_co[4]),
      	 .a(add_prod3_s[3]), .b(add_prod3_co[3]), .ci(sum0_co[3])),
   sum4(.s(sum[4]), .co(sum0_co[5]),
      	 .a(add_prod3_s[4]), .b(add_prod3_co[4]), .ci(sum0_co[4]));
ni01d3
   carry_sel0(.z(sel_carry0), .i(sum0_co[5]));

ad01d1
sum0_5(.s(sum0[5]), .co(sum0_co[6]), 
                .a(add_prod3_s[5]), .b(add_prod3_co[5]), .ci(1'h0)),
sum1_5(.s(sum1[5]), .co(sum1_co[6]), 
                .a(add_prod3_s[5]), .b(add_prod3_co[5]), .ci(1'h1)),
sum0_6(.s(sum0[6]), .co(sum0_co[7]), 
                .a(add_prod3_s[6]), .b(add_prod3_co[6]), .ci(sum0_co[6])),
sum1_6(.s(sum1[6]), .co(sum1_co[7]), 
                .a(add_prod3_s[6]), .b(add_prod3_co[6]), .ci(sum1_co[6])),
sum0_7(.s(sum0[7]), .co(sum0_co[8]), 
                .a(add_prod3_s[7]), .b(add_prod3_co[7]), .ci(sum0_co[7])),
sum1_7(.s(sum1[7]), .co(sum1_co[8]), 
                .a(add_prod3_s[7]), .b(add_prod3_co[7]), .ci(sum1_co[7])),
sum0_8(.s(sum0[8]), .co(sum0_co[9]), 
                .a(add_prod3_s[8]), .b(add_prod3_co[8]), .ci(sum0_co[8])),
sum1_8(.s(sum1[8]), .co(sum1_co[9]), 
                .a(add_prod3_s[8]), .b(add_prod3_co[8]), .ci(sum1_co[8]));

mx21d1
   carry_mx1(.z(sel_carry1_m), .i0(sum0_co[9]), .i1(sum1_co[9]), .s(sum0_co[5]));
ni01d3
   carry_sel1(.z(sel_carry1), .i(sel_carry1_m));

ad01d1   
sum0_9(.s(sum0[9]), .co(sum0_co[10]), 
                .a(add_prod3_s[9]), .b(add_prod3_co[9]), .ci(1'h0)),
sum1_9(.s(sum1[9]), .co(sum1_co[10]), 
                .a(add_prod3_s[9]), .b(add_prod3_co[9]), .ci(1'h1)),
sum0_10(.s(sum0[10]), .co(sum0_co[11]), 
                .a(add_prod3_s[10]), .b(add_prod3_co[10]), .ci(sum0_co[10])),
sum1_10(.s(sum1[10]), .co(sum1_co[11]), 
                .a(add_prod3_s[10]), .b(add_prod3_co[10]), .ci(sum1_co[10])),
sum0_11(.s(sum0[11]), .co(sum0_co[12]), 
                .a(add_prod3_s[11]), .b(add_prod3_co[11]), .ci(sum0_co[11])),
sum1_11(.s(sum1[11]), .co(sum1_co[12]), 
                .a(add_prod3_s[11]), .b(add_prod3_co[11]), .ci(sum1_co[11])),
sum0_12(.s(sum0[12]), .co(sum0_co[13]), 
                .a(add_prod3_s[12]), .b(add_prod3_co[12]), .ci(sum0_co[12])),
sum1_12(.s(sum1[12]), .co(sum1_co[13]), 
                .a(add_prod3_s[12]), .b(add_prod3_co[12]), .ci(sum1_co[12]));

mx21d1
   carry_mx2(.z(sel_carry2_m), .i0(sum0_co[13]), .i1(sum1_co[13]), .s(sel_carry1_m));
ni01d3
   carry_sel2(.z(sel_carry2), .i(sel_carry2_m));

ad01d1
sum0_13(.s(sum0[13]), .co(sum0_co[14]), 
                .a(add_prod3_s[13]), .b(add_prod3_co[13]), .ci(1'h0)),
sum1_13(.s(sum1[13]), .co(sum1_co[14]), 
                .a(add_prod3_s[13]), .b(add_prod3_co[13]), .ci(1'h1)),
sum0_14(.s(sum0[14]), .co(sum0_co[15]), 
                .a(add_prod3_s[14]), .b(add_prod3_co[14]), .ci(sum0_co[14])),
sum1_14(.s(sum1[14]), .co(sum1_co[15]), 
                .a(add_prod3_s[14]), .b(add_prod3_co[14]), .ci(sum1_co[14])),
sum0_15(.s(sum0[15]), .co(sum0_co[16]), 
                .a(add_prod3_s[15]), .b(add_prod3_co[15]), .ci(sum0_co[15])),
sum1_15(.s(sum1[15]), .co(sum1_co[16]), 
                .a(add_prod3_s[15]), .b(add_prod3_co[15]), .ci(sum1_co[15])),
sum0_16(.s(sum0[16]), .co(sum0_co[17]), 
                .a(add_prod3_s[16]), .b(add_prod3_co[16]), .ci(sum0_co[16])),
sum1_16(.s(sum1[16]), .co(sum1_co[17]), 
                .a(add_prod3_s[16]), .b(add_prod3_co[16]), .ci(sum1_co[16])),
sum0_17(.s(sum0[17]), .co(sum0_co[18]), 
                .a(add_prod3_s[17]), .b(add_prod3_co[17]), .ci(sum0_co[17])),
sum1_17(.s(sum1[17]), .co(sum1_co[18]), 
                .a(add_prod3_s[17]), .b(add_prod3_co[17]), .ci(sum1_co[17]));


mx21d1
   carry_mx3(.z(sel_carry3_m), .i0(sum0_co[18]), .i1(sum1_co[18]), .s(sel_carry2_m));
ni01d3
   carry_sel3(.z(sel_carry3), .i(sel_carry3_m));

ad01d1
sum0_18(.s(sum0[18]), .co(sum0_co[19]), 
                .a(add_prod3_s[18]), .b(add_prod3_co[18]), .ci(1'h0)),
sum1_18(.s(sum1[18]), .co(sum1_co[19]), 
                .a(add_prod3_s[18]), .b(add_prod3_co[18]), .ci(1'h1)),
sum0_19(.s(sum0[19]), .co(sum0_co[20]), 
                .a(add_prod3_s[19]), .b(add_prod3_co[19]), .ci(sum0_co[19])),
sum1_19(.s(sum1[19]), .co(sum1_co[20]), 
                .a(add_prod3_s[19]), .b(add_prod3_co[19]), .ci(sum1_co[19])),
sum0_20(.s(sum0[20]), .co(sum0_co[21]), 
                .a(add_prod3_s[20]), .b(add_prod3_co[20]), .ci(sum0_co[20])),
sum1_20(.s(sum1[20]), .co(sum1_co[21]), 
                .a(add_prod3_s[20]), .b(add_prod3_co[20]), .ci(sum1_co[20])),
sum0_21(.s(sum0[21]), .co(sum0_co[22]), 
                .a(add_prod3_s[21]), .b(add_prod3_co[21]), .ci(sum0_co[21])),
sum1_21(.s(sum1[21]), .co(sum1_co[22]), 
                .a(add_prod3_s[21]), .b(add_prod3_co[21]), .ci(sum1_co[21])),
sum0_22(.s(sum0[22]), .co(sum0_co[23]), 
                .a(add_prod3_s[22]), .b(add_prod3_co[22]), .ci(sum0_co[22])),
sum1_22(.s(sum1[22]), .co(sum1_co[23]), 
                .a(add_prod3_s[22]), .b(add_prod3_co[22]), .ci(sum1_co[22])),
sum0_23(.s(sum0[23]), //.co(sum0_co[24]), 
                .a(add_prod3_s[23]), .b(add_prod3_co[23]), .ci(sum0_co[23])),
sum1_23(.s(sum1[23]), // .co(sum1_co[24]), 
                .a(add_prod3_s[23]), .b(add_prod3_co[23]), .ci(sum1_co[23]));

mx21d1
sum5(.z(sum[5]), .i0(sum0[5]), .i1(sum1[5]), .s(sel_carry0)),
sum6(.z(sum[6]), .i0(sum0[6]), .i1(sum1[6]), .s(sel_carry0)),
sum7(.z(sum[7]), .i0(sum0[7]), .i1(sum1[7]), .s(sel_carry0)),
sum8(.z(sum[8]), .i0(sum0[8]), .i1(sum1[8]), .s(sel_carry0)),
sum9(.z(sum[9]), .i0(sum0[9]), .i1(sum1[9]), .s(sel_carry1)),
sum10(.z(sum[10]), .i0(sum0[10]), .i1(sum1[10]), .s(sel_carry1)),
sum11(.z(sum[11]), .i0(sum0[11]), .i1(sum1[11]), .s(sel_carry1)),
sum12(.z(sum[12]), .i0(sum0[12]), .i1(sum1[12]), .s(sel_carry1)),
sum13(.z(sum[13]), .i0(sum0[13]), .i1(sum1[13]), .s(sel_carry2)),
sum14(.z(sum[14]), .i0(sum0[14]), .i1(sum1[14]), .s(sel_carry2)),
sum15(.z(sum[15]), .i0(sum0[15]), .i1(sum1[15]), .s(sel_carry2)),
sum16(.z(sum[16]), .i0(sum0[16]), .i1(sum1[16]), .s(sel_carry2)),
sum17(.z(sum[17]), .i0(sum0[17]), .i1(sum1[17]), .s(sel_carry2)),
sum18(.z(sum[18]), .i0(sum0[18]), .i1(sum1[18]), .s(sel_carry3)),
sum19(.z(sum[19]), .i0(sum0[19]), .i1(sum1[19]), .s(sel_carry3)),
sum20(.z(sum[20]), .i0(sum0[20]), .i1(sum1[20]), .s(sel_carry3)),
sum21(.z(sum[21]), .i0(sum0[21]), .i1(sum1[21]), .s(sel_carry3)),
sum22(.z(sum[22]), .i0(sum0[22]), .i1(sum1[22]), .s(sel_carry3)),
sum23(.z(sum[23]), .i0(sum0[23]), .i1(sum1[23]), .s(sel_carry3));

assign  att_data_out = sum[23:5];
endmodule  //  stzoffset1