-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJumpControl.v
More file actions
76 lines (74 loc) · 1.44 KB
/
Copy pathJumpControl.v
File metadata and controls
76 lines (74 loc) · 1.44 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 12:26:40 11/04/2022
// Design Name:
// Module Name: JumpControl
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module JumpControl(
input [2:0] flag, // flag = [2-sign,1-zero,0-carry]
input [2:0] CondJump,
output reg [0:0] JCout
);
always@(*)
begin
case(CondJump)
3'b000: // not a branch on flag statement
begin
JCout <= 1'b0;
end
3'b001: // bltz
begin
if(flag[2])
JCout <= 1'b1;
else
JCout <= 1'b0;
end
3'b010: // bz
begin
if(flag[1])
JCout <= 1'b1;
else
JCout <= 1'b0;
end
3'b011: // bnz
begin
if(flag[1])
JCout <= 1'b0;
else
JCout <= 1'b1;
end
3'b100: // bcy
begin
if(flag[0])
JCout <= 1'b1;
else
JCout <= 1'b0;
end
3'b101: // bncy
begin
if(flag[0])
JCout <= 1'b0;
else
JCout <= 1'b1;
end
default: // default ---> UncondJump shouldn't happen
begin
JCout <= 1'b0;
end
endcase
end
endmodule