OpenCores
URL https://opencores.org/ocsvn/fpga-cf/fpga-cf/trunk

Subversion Repositories fpga-cf

[/] [fpga-cf/] [trunk/] [hdl/] [PATLPP/] [comparelogic/] [comparelogic.v] - Rev 5

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

// Compare logic
 
module comparelogic
(
	input		[15:0]		data,
	input		[1:0]			mode,
	output	reg			result
);
 
always @(data or mode)
begin
	case (mode)
		0: result = ~( | data ); // ==
		1: result = ~( data[15] && ( | data )); // >
		2: result = ( data[15] && ( | data )); // <
		3: result = ( | data ); // !=
		default: $display("Error in CompareLogic Case");
	endcase
end
 
endmodule
 

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

powered by: WebSVN 2.1.0

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