From 80d5f21b40577ac2d95516c6e9eacd758ae62303 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 5 Jul 2019 22:56:26 +0100 Subject: [PATCH] whoops no e_start-1 in fpnum decode --- src/ieee754/fpcommon/fpbase.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ieee754/fpcommon/fpbase.py b/src/ieee754/fpcommon/fpbase.py index 38715f99..f25264fa 100644 --- a/src/ieee754/fpcommon/fpbase.py +++ b/src/ieee754/fpcommon/fpbase.py @@ -398,7 +398,7 @@ class FPNumDecode(FPNumBase): is extended to 10 bits so that subtract 127 is done on a 10-bit number """ - args = [0] * self.m_extra + [v[0:self.e_start+1]] # pad with extra zeros + args = [0] * self.m_extra + [v[0:self.e_start]] # pad with extra zeros #print ("decode", self.e_end) return [self.m.eq(Cat(*args)), # mantissa self.e.eq(v[self.e_start:self.e_end] - self.fp.P127), # exp @@ -430,7 +430,7 @@ class FPNumIn(FPNumBase): a 10-bit number """ v = self.v - args = [0] * self.m_extra + [v[0:self.e_start+1]] # pad with extra zeros + args = [0] * self.m_extra + [v[0:self.e_start]] # pad with extra zeros #print ("decode", self.e_end) res = ObjectProxy(m, pipemode=False) res.m = Cat(*args) # mantissa @@ -445,7 +445,7 @@ class FPNumIn(FPNumBase): is extended to 10 bits so that subtract 127 is done on a 10-bit number """ - args = [0] * self.m_extra + [v[0:self.e_start+1]] # pad with extra zeros + args = [0] * self.m_extra + [v[0:self.e_start]] # pad with extra zeros #print ("decode", self.e_end) return [self.m.eq(Cat(*args)), # mantissa self.e.eq(v[self.e_start:self.e_end] - self.P127), # exp -- 2.30.2