add set-to-zero function
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 14 Feb 2019 12:47:12 +0000 (12:47 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 14 Feb 2019 12:47:12 +0000 (12:47 +0000)
src/add/nmigen_add_experiment.py

index 914074c9a5b80567ad97b2b2747fdd6381d181c0..ae5d5892ba116e948436f3cb8e643dc68e0299cd 100644 (file)
@@ -47,6 +47,9 @@ class FPNum:
     def inf(self, s):
         return self.create(s, 0x80, 0)
 
+    def zero(self, s):
+        return self.create(s, -127, 0)
+
     def is_nan(self):
         return (self.e == 128) & (self.m != 0)