projects
/
ieee754fpu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Created the normalise function
[ieee754fpu.git]
/
src
/
add
/
fsqrt.py
diff --git
a/src/add/fsqrt.py
b/src/add/fsqrt.py
index e0696ebcdbdce37e8df41f9dec58b42f620b5036..8e11666705d85aedcdae3c07fa9bb76faee1994f 100644
(file)
--- 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: