mirror of
https://github.com/supleed2/ELEC50010-IAC-CW.git
synced 2024-12-22 21:35:48 +00:00
Fix signed error in alu block
This commit is contained in:
parent
2e17e38957
commit
fc5c8a17f5
|
@ -77,19 +77,19 @@ Ops ALUOps; //Note confusing naming to avoid potential duplicate variable naming
|
||||||
assign ALUOps = ALUOp;
|
assign ALUOps = ALUOp;
|
||||||
case(ALUOps)
|
case(ALUOps)
|
||||||
ADD: begin
|
ADD: begin
|
||||||
$signed(ALURes) = $signed(A) + $signed(B);
|
ALURes = $signed(A) + $signed(B);
|
||||||
end
|
end
|
||||||
|
|
||||||
SUB: begin
|
SUB: begin
|
||||||
$signed(ALURes) = $signed(A) - $signed(B) ;
|
ALURes = $signed(A) - $signed(B);
|
||||||
end
|
end
|
||||||
|
|
||||||
MUL: begin
|
MUL: begin
|
||||||
$signed(ALURes) = $signed(A) * $signed(B);
|
ALURes = $signed(A) * $signed(B);
|
||||||
end
|
end
|
||||||
|
|
||||||
DIV: begin
|
DIV: begin
|
||||||
$signed(ALURes) = $signed(A) / $signed(B);
|
ALURes = $signed(A) / $signed(B);
|
||||||
end
|
end
|
||||||
|
|
||||||
AND: begin
|
AND: begin
|
||||||
|
@ -121,11 +121,11 @@ Ops ALUOps; //Note confusing naming to avoid potential duplicate variable naming
|
||||||
end
|
end
|
||||||
|
|
||||||
SRA: begin
|
SRA: begin
|
||||||
$signed(ALURes) = $signed(B) >>> shamt;
|
ALURes = $signed(B) >>> shamt;
|
||||||
end
|
end
|
||||||
|
|
||||||
SRAV: begin
|
SRAV: begin
|
||||||
$signed(ALURes) = $signed(B) >>> A;
|
ALURes = $signed(B) >>> A;
|
||||||
end
|
end
|
||||||
|
|
||||||
EQ: begin
|
EQ: begin
|
||||||
|
@ -205,11 +205,11 @@ Ops ALUOps; //Note confusing naming to avoid potential duplicate variable naming
|
||||||
end
|
end
|
||||||
|
|
||||||
MULU: begin
|
MULU: begin
|
||||||
$signed(ALURes) = $signed(A) * $signed(B);
|
ALURes = $signed(A) * $signed(B);
|
||||||
end
|
end
|
||||||
|
|
||||||
DIVU: begin
|
DIVU: begin
|
||||||
$signed(ALURes) = $signed(A) / $signed(B);
|
ALURes = $signed(A) / $signed(B);
|
||||||
end
|
end
|
||||||
|
|
||||||
endcase
|
endcase
|
||||||
|
|
Loading…
Reference in a new issue