From ec2c446c7ef508ff514d3fb15cccf10b8e6f411d Mon Sep 17 00:00:00 2001 From: Katherine Parry Date: Thu, 23 Jun 2022 23:01:30 +0000 Subject: [PATCH] forgot a file --- pipelined/src/fpu/divshiftcalc.sv | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 pipelined/src/fpu/divshiftcalc.sv diff --git a/pipelined/src/fpu/divshiftcalc.sv b/pipelined/src/fpu/divshiftcalc.sv new file mode 100644 index 000000000..57022e5ae --- /dev/null +++ b/pipelined/src/fpu/divshiftcalc.sv @@ -0,0 +1,15 @@ +`include "wally-config.vh" + +module divshiftcalc( + input logic [`DIVLEN+2:0] Quot, + input logic [`NE:0] DivCalcExpM, + output logic [$clog2(`NORMSHIFTSZ)-1:0] DivShiftAmt, + output logic [`NE:0] CorrDivExp +); + + assign DivShiftAmt = {{$clog2(`NORMSHIFTSZ)-1{1'b0}}, ~Quot[`DIVLEN+2]}; + // the quotent is in the range [.5,2) + // if the quotent < 1 and not denormal then subtract 1 to account for the normalization shift + assign CorrDivExp = DivCalcExpM - {(`NE)'(0), ~Quot[`DIVLEN+2]}; + +endmodule