From dde37c31a72f4773e95faf8223ef450440bdb62c Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Sun, 17 Jan 2021 12:57:21 -0600 Subject: get rid of that trash --- OLD/ee4363/mp1/mp11/MIPSALU.v | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 OLD/ee4363/mp1/mp11/MIPSALU.v (limited to 'OLD/ee4363/mp1/mp11/MIPSALU.v') diff --git a/OLD/ee4363/mp1/mp11/MIPSALU.v b/OLD/ee4363/mp1/mp11/MIPSALU.v new file mode 100644 index 0000000..096aff5 --- /dev/null +++ b/OLD/ee4363/mp1/mp11/MIPSALU.v @@ -0,0 +1,18 @@ +module MIPSALU (ALUctl, A, B, ALUOut, Zero); + input [3:0] ALUctl; + input [31:0] A,B; + output reg [31:0] ALUOut; + output Zero; + assign Zero = (ALUOut==0); + always @(ALUctl, A, B) + case (ALUctl) + 0: ALUOut <= A & B; + 1: ALUOut <= A | B; + 2: ALUOut <= A + B; + 6: ALUOut <= A - B; + 7: ALUOut <= A < B ? 1:0; + 12: ALUOut <= ~(A | B); + default: ALUOut <= 0; + endcase +endmodule + -- cgit v1.2.3