From 688f4f6f6ce0737c05cda16bcaab6cf7d8ee72cb Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 17 Feb 2019 08:22:03 +0000 Subject: [PATCH] add extra comments --- src/add/fpbase.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/add/fpbase.py b/src/add/fpbase.py index aba8c967..6e1644f5 100644 --- 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): - """ 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 -- 2.30.2