sudp_alu.v 1.85 KB
/**************************************************************************
 *                                                                        *
 *               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: sudp_alu.v,v 1.1.1.1 2002/05/17 06:14:58 blythe Exp $

////////////////////////////////////////////////////////////////////////
//
// Project Reality
//
// module:      sudp_alu
// description: ALU for scalar unit, std cell version.
//
// designer:    Phil Gossett
// date:        4/3/95
//
////////////////////////////////////////////////////////////////////////

module sudp_alu (a, b, s, co30, co, ci, m);

input [31:0] a;
input [31:0] b;
output [31:0] s;
output co30;
output co;
input ci;
input [4:0] m;

wire [31:0] ac;
wire [31:0] bc;
wire [31:0] x;
wire [31:0] y;
wire [31:0] z;
wire [31:0] sum;
wire [31:0] log;

sudp_comp  cmpa (.i(a), .c(m[0]), .z(ac));
sudp_comp  cmpb (.i(b), .c(m[1]), .z(bc));
sudp_nand  logx (          .a(ac), .b(bc), .z(x));
sudp_mode  logy (.s(m[2]), .a(ac), .b(bc), .z(y));
sudp_nand  logz (.a(x), .b(y), .z(z));
sudp_comp  cmpl (.i(z), .c(m[3]), .z(log));
sudp_add32 adds (.a(ac), .b(bc), .ci(ci), .s(sum), .co(co), .co30(co30));
sudp_mx21  muxz (.s(m[4]), .i0(sum), .i1(log), .z(s));

endmodule // sudp_alu