Initial commit
This commit is contained in:
33
Exp4/Exp4.srcs/sources_1/new/judge.v
Normal file
33
Exp4/Exp4.srcs/sources_1/new/judge.v
Normal file
@@ -0,0 +1,33 @@
|
||||
`timescale 1ns / 1ps
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
// Company:
|
||||
// Engineer:
|
||||
//
|
||||
// Create Date: 2024/10/31 11:22:30
|
||||
// Design Name:
|
||||
// Module Name: judge
|
||||
// Project Name:
|
||||
// Target Devices:
|
||||
// Tool Versions:
|
||||
// Description:
|
||||
//
|
||||
// Dependencies:
|
||||
//
|
||||
// Revision:
|
||||
// Revision 0.01 - File Created
|
||||
// Additional Comments:
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
module judge(
|
||||
input [3:0] data1,
|
||||
input [3:0] data2,
|
||||
output reg [4:0] result
|
||||
);
|
||||
always @(*) begin
|
||||
if (data1 > data2) result = 4'b1000;
|
||||
else if (data1 < data2) result = 4'b0100;
|
||||
else if (data1 == data2) result = 4'b0010;
|
||||
end
|
||||
endmodule
|
||||
Reference in New Issue
Block a user