From 40e7f99d07484253630d09a339547f2db1ddd4ce Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 18 Feb 2019 11:55:33 +0000 Subject: [PATCH] fix a - b = zero by adding special case --- src/add/nmigen_add_experiment.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/add/nmigen_add_experiment.py b/src/add/nmigen_add_experiment.py index a751ea2e..7d9ccb71 100644 --- a/src/add/nmigen_add_experiment.py +++ b/src/add/nmigen_add_experiment.py @@ -88,6 +88,10 @@ class FPADD(FPBase): m.next = "put_z" m.d.sync += z.create(a.s, a.e, a.m[3:-1]) + with m.Elif((a.s != b.s) & (a.m == b.m) & (a.e == b.e)): + m.next = "put_z" + m.d.sync += z.zero(0) + # Denormalised Number checks with m.Else(): m.next = "align" -- 2.30.2