From 43160e6a268b380f3db92b6c7626123339b93c95 Mon Sep 17 00:00:00 2001 From: Aleksandar Kostovic Date: Tue, 30 Apr 2019 16:33:34 +0200 Subject: [PATCH] Created the normalise function --- src/add/fsqrt.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/add/fsqrt.py b/src/add/fsqrt.py index e0696ebc..8e116667 100644 --- a/src/add/fsqrt.py +++ b/src/add/fsqrt.py @@ -140,6 +140,16 @@ if __name__ == '__main__': x = Float32(0.123456) fsqrt_test(x) + +#normalization function +def normalise(s, m, e): + if (lowbits >= 2): + m += 1 + if get_mantissa(m) == ((1<<24)-1): + e += 1 + + + """ Notes: -- 2.30.2