mirror of
https://github.com/supleed2/ELEC50010-IAC-CW.git
synced 2024-11-10 01:35:49 +00:00
Minor sytax corrections
This commit is contained in:
parent
2a6d87c7b8
commit
b81c2c0952
|
@ -5,7 +5,7 @@ module mips_cpu_alu(
|
||||||
|
|
||||||
/* The ALU Flags is 6 bits for now update when reduced */
|
/* The ALU Flags is 6 bits for now update when reduced */
|
||||||
|
|
||||||
output logic ALUZero, //Is the output of the ALU 0? - used to check result
|
output logic Cond, //IF condition is met Cond is asserted
|
||||||
|
|
||||||
output logic[31:0] ALUOut, // The ouput of the ALU
|
output logic[31:0] ALUOut, // The ouput of the ALU
|
||||||
|
|
||||||
|
@ -36,10 +36,6 @@ module mips_cpu_alu(
|
||||||
//BNE = 6'd11, //Branch on not equal
|
//BNE = 6'd11, //Branch on not equal
|
||||||
//DIV = 6'd12, //Divide
|
//DIV = 6'd12, //Divide
|
||||||
//DIVU = 6'd13, //Divide unsigned
|
//DIVU = 6'd13, //Divide unsigned
|
||||||
J = 6'd14, //Jump
|
|
||||||
JALR = 6'd15, //Jump and link register
|
|
||||||
JAL = 6'd16, //Jump and link
|
|
||||||
JR = 6'd17, //Jump register
|
|
||||||
//LB = 6'd18, //Load byte
|
//LB = 6'd18, //Load byte
|
||||||
//LBU = 6'd19, //Load byte unsigned
|
//LBU = 6'd19, //Load byte unsigned
|
||||||
//LH = 6'd20, //Load half-word
|
//LH = 6'd20, //Load half-word
|
||||||
|
@ -79,7 +75,7 @@ module mips_cpu_alu(
|
||||||
|
|
||||||
} ALUFlags;
|
} ALUFlags;
|
||||||
|
|
||||||
always @(A,B, ALUFlags)
|
always_comb
|
||||||
begin
|
begin
|
||||||
|
|
||||||
SignExtend = {{16{immediate[15]}}, immediate};
|
SignExtend = {{16{immediate[15]}}, immediate};
|
||||||
|
@ -130,13 +126,13 @@ module mips_cpu_alu(
|
||||||
AND: begin
|
AND: begin
|
||||||
ALUOut = A & B;
|
ALUOut = A & B;
|
||||||
end
|
end
|
||||||
|
//kjfdhlkjsfhlsajdflskajflsjflskjf;lksjf;jsf;kl
|
||||||
BEQ: begin
|
BEQ: begin
|
||||||
if A == B begin
|
if A == B begin
|
||||||
ALUOut = 0;
|
Cond = 1;
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
ALUOut = ALUOut;
|
Cond = 0;
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -239,15 +235,7 @@ module mips_cpu_alu(
|
||||||
endcase
|
endcase
|
||||||
end
|
end
|
||||||
|
|
||||||
always @(ALUOut) begin
|
|
||||||
if (ALUOut == 0) begin
|
|
||||||
ALUZero <= 1;
|
|
||||||
end else begin
|
|
||||||
ALUZero <= 0;
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
endmodule
|
endmodule
|
Loading…
Reference in a new issue