Skip to content

Commit

Permalink
Update ALU.v
Browse files Browse the repository at this point in the history
  • Loading branch information
ravindu439 authored Dec 9, 2024
1 parent e450d89 commit 4e07918
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ALUunit/ALU.v
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ module alu (data1,data2,opcode,Output);
wire [63:0] mulh_result,mulhu_result,mulhsu_result;

assign mulh_result = $signed (data1)*$signed(data2) ; // Calculation of Multiplication High instruction
assign MULH_result = mulh_result[63:31];
assign MULH_result = mulh_result[63:32];

assign mulhu_result = $signed (data1)*$unsigned(data2) ; // Calculation of Multiplication high unsigned values instruction
assign MULHU_result = mulhu_result[63:31];
assign MULHU_result = mulhu_result[63:32];

assign mulhsu_result = $unsigned (data1)*$unsigned(data2) ; // Calculation of Multiplication high signed unsigned instruction
assign MULHSU_result = mulhsu_result[63:31];
assign MULHSU_result = mulhsu_result[63:32];


always @(*) begin
Expand All @@ -43,4 +43,4 @@ module alu (data1,data2,opcode,Output);
endcase
end

endmodule
endmodule

0 comments on commit 4e07918

Please sign in to comment.