source: XOpenSparcT1/trunk/T1-FPU/fpu_in2_gt_in1_2b.v @ 6

Revision 6, 1.7 KB checked in by pntsvt00, 14 years ago (diff)

versione iniziale opensparc

Line 
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T1 Processor File: fpu_in2_gt_in1_2b.v
4// Copyright (c) 2006 Sun Microsystems, Inc.  All Rights Reserved.
5// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
6//
7// The above named program is free software; you can redistribute it and/or
8// modify it under the terms of the GNU General Public
9// License version 2 as published by the Free Software Foundation.
10//
11// The above named program is distributed in the hope that it will be
12// useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14// General Public License for more details.
15//
16// You should have received a copy of the GNU General Public
17// License along with this work; if not, write to the Free Software
18// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
19//
20// ========== Copyright Header End ============================================
21///////////////////////////////////////////////////////////////////////////////
22//
23//      Two bit comparison of two inputs that can have any value.
24//
25///////////////////////////////////////////////////////////////////////////////
26
27module fpu_in2_gt_in1_2b (
28        din1,
29        din2,
30
31        din2_neq_din1,
32        din2_gt_din1
33);
34
35
36input [1:0]     din1;                   // input 1- 3 bits
37input [1:0]     din2;                   // input 2- 3 bits
38
39output          din2_neq_din1;          // input 2 doesn't equal input 1
40output          din2_gt_din1;           // input 2 is greater than input 1
41
42
43wire [1:0]      din2_eq_din1;
44wire            din2_neq_din1;
45wire            din2_gt_din1;
46
47
48assign din2_eq_din1[1:0]= (~(din1 ^ din2));
49
50assign din2_neq_din1= (!(&din2_eq_din1));
51
52assign din2_gt_din1= ((!din1[1]) && din2[1])
53                || (din2_eq_din1[1] && (!din1[0]) && din2[0]);
54
55
56endmodule
57
58
Note: See TracBrowser for help on using the repository browser.