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

Subversion Repositories async_sdm_noc

[/] [async_sdm_noc/] [trunk/] [common/] [src/] [comp4.v] - Blame information for rev 80

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

Line No. Rev Author Line
1 38 wsong0210
/*
2
 Asynchronous SDM NoC
3
 (C)2011 Wei Song
4
 Advanced Processor Technologies Group
5
 Computer Science, the Univ. of Manchester, UK
6
 
7
 Authors:
8
 Wei Song     wsong83@gmail.com
9
 
10
 License: LGPL 3.0 or later
11
 
12
 1-of-4 data comparator
13
 
14
 History:
15
 11/05/2010  Initial version. <wsong83@gmail.com>
16
 01/06/2011  Clean up for opensource. <wsong83@gmail.com>
17
 
18
*/
19
 
20
module comp4 (/*AUTOARG*/
21
   // Outputs
22
   q,
23
   // Inputs
24
   a, b
25
   );
26
 
27
   input [3:0]   a, b;           // the data inputs to be compared
28
   output [2:0]  q;              // the comparison result
29
 
30
   // a > b
31
   assign q[0] = (a[3]&(|b[2:0])) | (a[2]&(|b[1:0])) | (a[1]&(|b[0:0]));
32
 
33
   // a < b
34
   assign q[1] = (a[2]&(|b[3:3])) | (a[1]&(|b[3:2])) | (a[0]&(|b[3:1]));
35
 
36
   // a = b
37
   assign q[2] = (a[3]&b[3]) | (a[2]&b[2]) | (a[1]&b[1]) | (a[0]&b[0]);
38
 
39
endmodule // comp4

powered by: WebSVN 2.1.0

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