-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathALU_Control.v
More file actions
40 lines (37 loc) · 946 Bytes
/
Copy pathALU_Control.v
File metadata and controls
40 lines (37 loc) · 946 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
36
37
38
39
40
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 28.05.2026 03:15:28
// Design Name:
// Module Name: ALU_Control
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module ALU_Control(ALUOp, fun7,fun3,Control_out);
input fun7;
input [1:0] ALUOp;
input [2:0] fun3;
output reg [3:0] Control_out;
always @(*)begin
case({ALUOp,fun7,fun3})
6'b00_0_000: Control_out<=4'b0010;
6'b01_0_000: Control_out<=4'b0110;
6'b10_0_000: Control_out<=4'b0010;
6'b10_1_000: Control_out<=4'b0110;
6'b10_0_111: Control_out<=4'b0000;
6'b10_0_110: Control_out<=4'b0001;
default: Control_out <= 4'b0000;
endcase
end
endmodule