File size: 414 Bytes
78c261f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | // buile alu module here
module alu(
input [31:0] a,
input [31:0] b,
input [2:0] op,
output reg [31:0] out
);
always @(*) begin
case (op)
3'b000: out = a + b;
3'b001: out = a - b;
3'b010: out = a & b;
3'b011: out = a << b;
3'b100: out = a >> b;
endcase
end
endmodule
// build alu test bench here
|