OpenCores
URL https://opencores.org/ocsvn/sparc64soc/sparc64soc/trunk

Subversion Repositories sparc64soc

[/] [sparc64soc/] [trunk/] [T1-FPU/] [fpu_in2_gt_in1_3b.v] - Blame information for rev 3

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dmitryr
// ========== Copyright Header Begin ==========================================
2
// 
3
// OpenSPARC T1 Processor File: fpu_in2_gt_in1_3b.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
//      Three bit comparison of two inputs that can have any value.
24
//
25
///////////////////////////////////////////////////////////////////////////////
26
 
27
module fpu_in2_gt_in1_3b (
28
        din1,
29
        din2,
30
 
31
        din2_neq_din1,
32
        din2_gt_din1
33
);
34
 
35
 
36
input [2:0]      din1;                   // input 1- 3 bits
37
input [2:0]      din2;                   // input 2- 3 bits
38
 
39
output          din2_neq_din1;          // input 2 doesn't equal input 1
40
output          din2_gt_din1;           // input 2 is greater than input 1
41
 
42
 
43
wire [2:0]       din2_eq_din1;
44
wire            din2_neq_din1;
45
wire            din2_gt_din1;
46
 
47
 
48
assign din2_eq_din1[2:0]= (~(din1 ^ din2));
49
 
50
assign din2_neq_din1= (!(&din2_eq_din1));
51
 
52
assign din2_gt_din1= ((!din1[2]) && din2[2])
53
                || (din2_eq_din1[2] && (!din1[1]) && din2[1])
54
                || ((&din2_eq_din1[2:1]) && (!din1[0]) && din2[0]);
55
 
56
 
57
endmodule
58
 
59
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.