From d30d28fd7c323582d79cf949fcd865d187fb9b9d Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 18 Feb 2019 12:05:26 +0000 Subject: [PATCH] whoops set mantissa = -127 instead of exponent... oops... --- src/add/fpbase.py | 2 +- src/add/test_add.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/add/fpbase.py b/src/add/fpbase.py index 8c10d782..e18df3a5 100644 --- a/src/add/fpbase.py +++ b/src/add/fpbase.py @@ -308,7 +308,7 @@ class FPBase: m.next = next_state # denormalised, correct exponent to zero with m.If(z.is_denormalised()): - m.d.sync += z.m.eq(z.N127) + m.d.sync += z.e.eq(z.N127) # FIX SIGN BUG: -a + a = +0. with m.If((z.e == z.N126) & (z.m[0:] == 0)): m.d.sync += z.s.eq(0) diff --git a/src/add/test_add.py b/src/add/test_add.py index 8347c556..9a8ebe97 100644 --- a/src/add/test_add.py +++ b/src/add/test_add.py @@ -120,6 +120,7 @@ def run_test(dut, stimulus_a, stimulus_b): sys.exit(0) def testbench(dut): + yield from check_case(dut, 0x82471f51, 0x243985f, 0x801c3790) yield from check_case(dut, 0, 0, 0) yield from check_case(dut, 0x40000000, 0xc0000000, 0x00000000) yield from check_case(dut, 0x3F800000, 0x40000000, 0x40400000) -- 2.30.2