From: Luke Kenneth Casson Leighton Date: Tue, 19 Feb 2019 08:05:29 +0000 (+0000) Subject: whoops FP16 mantissa off-by-one X-Git-Tag: ls180-24jan2020~1871 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5c0058aba5b26ccf44564b4cc490a08323786983;p=ieee754fpu.git whoops FP16 mantissa off-by-one --- diff --git a/src/add/fpbase.py b/src/add/fpbase.py index 5c303046..e6222c2f 100644 --- a/src/add/fpbase.py +++ b/src/add/fpbase.py @@ -70,7 +70,7 @@ class FPNum: """ def __init__(self, width, m_extra=True): self.width = width - m_width = {16: 12, 32: 24, 64: 53}[width] # 1 extra bit (overflow) + m_width = {16: 11, 32: 24, 64: 53}[width] # 1 extra bit (overflow) e_width = {16: 7, 32: 10, 64: 13}[width] # 2 extra bits (overflow) e_max = 1<<(e_width-3) self.rmw = m_width # real mantissa width (not including extras)