-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathComparer.v
More file actions
35 lines (33 loc) · 810 Bytes
/
Copy pathComparer.v
File metadata and controls
35 lines (33 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 22:03:51 11/23/2016
// Design Name:
// Module Name: Comparer
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module Comparer(
input [31:0] D1,
input [31:0] D2,
input CmpOp,
output Zero,
output LZero
);
wire [31:0] CmpRst = (CmpOp == 0) ? D1 : // Óë0±È½Ï
(CmpOp == 1) ? D1 - D2: // Á½Êý±È½Ï
32'dz;
assign Zero = (CmpRst==0);
assign LZero = CmpRst[31];
endmodule