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;
|
||||
case(ALUOps)
|
||||
ADD: begin
|
||||
$signed(ALURes) = $signed(A) + $signed(B);
|
||||
ALURes = $signed(A) + $signed(B);
|
||||
end
|
||||
|
||||
SUB: begin
|
||||
$signed(ALURes) = $signed(A) - $signed(B) ;
|
||||
ALURes = $signed(A) - $signed(B);
|
||||
end
|
||||
|
||||
MUL: begin
|
||||
$signed(ALURes) = $signed(A) * $signed(B);
|
||||
ALURes = $signed(A) * $signed(B);
|
||||
end
|
||||
|
||||
DIV: begin
|
||||
$signed(ALURes) = $signed(A) / $signed(B);
|
||||
ALURes = $signed(A) / $signed(B);
|
||||
end
|
||||
|
||||
AND: begin
|
||||
|
@ -121,11 +121,11 @@ Ops ALUOps; //Note confusing naming to avoid potential duplicate variable naming
|
|||
end
|
||||
|
||||
SRA: begin
|
||||
$signed(ALURes) = $signed(B) >>> shamt;
|
||||
ALURes = $signed(B) >>> shamt;
|
||||
end
|
||||
|
||||
SRAV: begin
|
||||
$signed(ALURes) = $signed(B) >>> A;
|
||||
ALURes = $signed(B) >>> A;
|
||||
end
|
||||
|
||||
EQ: begin
|
||||
|
@ -205,11 +205,11 @@ Ops ALUOps; //Note confusing naming to avoid potential duplicate variable naming
|
|||
end
|
||||
|
||||
MULU: begin
|
||||
$signed(ALURes) = $signed(A) * $signed(B);
|
||||
ALURes = $signed(A) * $signed(B);
|
||||
end
|
||||
|
||||
DIVU: begin
|
||||
$signed(ALURes) = $signed(A) / $signed(B);
|
||||
ALURes = $signed(A) / $signed(B);
|
||||
end
|
||||
|
||||
endcase
|
||||
|
|
Loading…
Reference in a new issue