projects
/
ieee754fpu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
aa66b49
)
add extra comments
author
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Sun, 17 Feb 2019 08:22:03 +0000
(08:22 +0000)
committer
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Sun, 17 Feb 2019 08:22:03 +0000
(08:22 +0000)
src/add/fpbase.py
patch
|
blob
|
history
diff --git
a/src/add/fpbase.py
b/src/add/fpbase.py
index aba8c9676e33b1aac1527a78b298138f2ecd2e5b..6e1644f5fd3c86fddfd2a0778ff495265461c483 100644
(file)
--- a/
src/add/fpbase.py
+++ b/
src/add/fpbase.py
@@
-149,7
+149,14
@@
class FPBase:
m.d.sync += op.ack.eq(1)
def denormalise(self, m, a):
m.d.sync += op.ack.eq(1)
def denormalise(self, m, a):
- """ denormalises a number
+ """ denormalises a number. this is probably the wrong name for
+ this function. for normalised numbers (exponent != minimum)
+ one *extra* bit (the implicit 1) is added *back in*.
+ for denormalised numbers, the mantissa is left alone
+ and the exponent increased by 1.
+
+ both cases *effectively multiply the number stored by 2*,
+ which has to be taken into account when extracting the result.
"""
with m.If(a.e == a.N127):
m.d.sync += a.e.eq(a.N126) # limit a exponent
"""
with m.If(a.e == a.N127):
m.d.sync += a.e.eq(a.N126) # limit a exponent