mirror of
https://github.com/supleed2/ELEC50010-IAC-CW.git
synced 2024-12-22 21:35:48 +00:00
-
This commit is contained in:
parent
888bb7c822
commit
a56410ceae
|
@ -9,13 +9,10 @@ module mips_cpu_alu(
|
||||||
|
|
||||||
output logic[31:0] ALUOut, // The ouput of the ALU
|
output logic[31:0] ALUOut, // The ouput of the ALU
|
||||||
|
|
||||||
input logic[15:0] immediate,
|
|
||||||
|
|
||||||
input logic[4:0] shamt
|
input logic[4:0] shamt
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
input [15:0] immediate;
|
|
||||||
|
|
||||||
reg [31:0] SignExtend, ZeroExtend;
|
reg [31:0] SignExtend, ZeroExtend;
|
||||||
// Instructions commented out have been accounted for
|
// Instructions commented out have been accounted for
|
||||||
|
@ -139,38 +136,38 @@ module mips_cpu_alu(
|
||||||
|
|
||||||
BGEZ: begin
|
BGEZ: begin
|
||||||
if A>=0 begin
|
if A>=0 begin
|
||||||
ALUOut = 0;
|
Cond = 1;
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
ALUOut = ALUOut;
|
Cond = 0;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
BGEZAL: begin
|
BGEZAL: begin
|
||||||
if A>=0 begin
|
if A>=0 begin
|
||||||
ALUOut = 0;
|
Cond = 1;
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
ALUOut = ALUOut;
|
Cond = 0;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
BGTZ: begin
|
BGTZ: begin
|
||||||
if A>0 begin
|
if A>0 begin
|
||||||
ALUOut = 0;
|
Cond = 1;
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
ALUOut = ALUOut;
|
Cond = 0;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
BLEZ: begin
|
BLEZ: begin
|
||||||
if A<=0 begin
|
if A<=0 begin
|
||||||
ALUOut = 0;
|
Cond = 1;
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
ALUOut = ALUOut;
|
Cond = 0;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue