From 876ac726e07b3c1ee26bccd8b596de424f0697be Mon Sep 17 00:00:00 2001 From: lkcl Date: Sun, 24 Apr 2022 21:47:51 +0100 Subject: [PATCH] --- openpower/sv/biginteger/analysis.mdwn | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/openpower/sv/biginteger/analysis.mdwn b/openpower/sv/biginteger/analysis.mdwn index 567975d5a..c77a7a859 100644 --- a/openpower/sv/biginteger/analysis.mdwn +++ b/openpower/sv/biginteger/analysis.mdwn @@ -368,3 +368,13 @@ there is no reason why it should not be adapted to Fixed Point. In this way a Scalar Integer divide can be performed in the same time-order as Newton-Raphson, using two hardware multipliers and a subtract. + +``` + k = 0; // the case of a + for (j = m - 1; j >= 0; j--) + { // single-digit + uint64_t dig2 = (k * b + u[j]); + q[j] = dig2 / v[0]; // divisor here. + k = dig2 % v[0]; // modulo bak into next loop + } +``` -- 2.30.2