sudp_alu.v
1.85 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
/**************************************************************************
* *
* 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