From 7a596346d426eb2dac0110759e5d1842ec76340f Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 14 Feb 2019 12:47:01 +0000 Subject: [PATCH] fix bug in nan/inf, exp-bias needed subtracting --- src/add/nmigen_add_experiment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/add/nmigen_add_experiment.py b/src/add/nmigen_add_experiment.py index 68d15bd4..914074c9 100644 --- a/src/add/nmigen_add_experiment.py +++ b/src/add/nmigen_add_experiment.py @@ -42,10 +42,10 @@ class FPNum: Cat(self.m[0] | self.m[1], self.m[1:-5], 0)) def nan(self, s): - return self.create(s, 0xff, 1<<22) + return self.create(s, 0x80, 1<<22) def inf(self, s): - return self.create(s, 0xff, 0) + return self.create(s, 0x80, 0) def is_nan(self): return (self.e == 128) & (self.m != 0) -- 2.30.2