URL
https://opencores.org/ocsvn/async_sdm_noc/async_sdm_noc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 38 |
Rev 47 |
/*
|
/*
|
Asynchronous SDM NoC
|
Asynchronous SDM NoC
|
(C)2011 Wei Song
|
(C)2011 Wei Song
|
Advanced Processor Technologies Group
|
Advanced Processor Technologies Group
|
Computer Science, the Univ. of Manchester, UK
|
Computer Science, the Univ. of Manchester, UK
|
|
|
Authors:
|
Authors:
|
Wei Song wsong83@gmail.com
|
Wei Song wsong83@gmail.com
|
|
|
License: LGPL 3.0 or later
|
License: LGPL 3.0 or later
|
|
|
1-of-4 data comparator
|
1-of-4 data comparator
|
|
|
History:
|
History:
|
11/05/2010 Initial version. <wsong83@gmail.com>
|
11/05/2010 Initial version. <wsong83@gmail.com>
|
01/06/2011 Clean up for opensource. <wsong83@gmail.com>
|
01/06/2011 Clean up for opensource. <wsong83@gmail.com>
|
|
|
*/
|
*/
|
|
|
module comp4 (/*AUTOARG*/
|
module comp4 (/*AUTOARG*/
|
// Outputs
|
// Outputs
|
q,
|
q,
|
// Inputs
|
// Inputs
|
a, b
|
a, b
|
);
|
);
|
|
|
input [3:0] a, b; // the data inputs to be compared
|
input [3:0] a, b; // the data inputs to be compared
|
output [2:0] q; // the comparison result
|
output [2:0] q; // the comparison result
|
|
|
// a > b
|
// a > b
|
assign q[0] = (a[3]&(|b[2:0])) | (a[2]&(|b[1:0])) | (a[1]&(|b[0:0]));
|
assign q[0] = (a[3]&(|b[2:0])) | (a[2]&(|b[1:0])) | (a[1]&(|b[0:0]));
|
|
|
// a < b
|
// a < b
|
assign q[1] = (a[2]&(|b[3:3])) | (a[1]&(|b[3:2])) | (a[0]&(|b[3:1]));
|
assign q[1] = (a[2]&(|b[3:3])) | (a[1]&(|b[3:2])) | (a[0]&(|b[3:1]));
|
|
|
// a = b
|
// a = b
|
assign q[2] = (a[3]&b[3]) | (a[2]&b[2]) | (a[1]&b[1]) | (a[0]&b[0]);
|
assign q[2] = (a[3]&b[3]) | (a[2]&b[2]) | (a[1]&b[1]) | (a[0]&b[0]);
|
|
|
endmodule // comp4
|
endmodule // comp4
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.