diff --git a/rtl/ibex_multdiv_fast.sv b/rtl/ibex_multdiv_fast.sv index 1e4026b9..ed1fc130 100644 --- a/rtl/ibex_multdiv_fast.sv +++ b/rtl/ibex_multdiv_fast.sv @@ -118,6 +118,10 @@ module ibex_multdiv_fast ( assign multdiv_result_o = div_en_i ? mac_res_q[31:0] : mac_res_n[31:0]; + // The 2 MSBs of mac_res_ext (mac_res_ext[34:33]) are always equal since: + // 1. The 2 MSBs of the multiplicants are always equal, and + // 2. The 16 MSBs of the addend (accum[33:18]) are always equal. + // Thus, it is safe to ignore mac_res_ext[34]. assign mac_res_signed = $signed({sign_a, mult_op_a})*$signed({sign_b, mult_op_b}) + $signed(accum); assign mac_res_ext = $unsigned(mac_res_signed); assign mac_res = mac_res_ext[33:0];