From 749109f2e5caf92367a70587f54555ef5913e454 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 14 Feb 2019 08:38:57 +0000 Subject: [PATCH] whoops accidentally indented too far --- src/add/nmigen_add_experiment.py | 44 +++++++++++++++++--------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/src/add/nmigen_add_experiment.py b/src/add/nmigen_add_experiment.py index 6628d766..5eb20770 100644 --- a/src/add/nmigen_add_experiment.py +++ b/src/add/nmigen_add_experiment.py @@ -184,28 +184,30 @@ class FPADD: with m.Else(): m.d.sync += b_m[26].eq(1) # set highest mantissa bit - # First stage of add - with m.State("add_0"): - m.next = "add_1" - m.d.sync += z_e.eq(a_e) - # same-sign (both negative or both positive) add mantissas - with m.If(a_s == b_s): - m.d.sync += [ - tot.eq(a_m + b_m), - z_s.eq(a_s) - ] - # a mantissa greater than b, use a - with m.Else(a_m >= b_m): - m.d.sync += [ - tot.eq(a_m - b_m), - z_s.eq(a_s) - ] - # b mantissa greater than a, use b - with m.Else(): - m.sync += [ - tot.eq(b_m - a_m), - z_s.eq(b_s) + # ****** + # First stage of add + + with m.State("add_0"): + m.next = "add_1" + m.d.sync += z_e.eq(a_e) + # same-sign (both negative or both positive) add mantissas + with m.If(a_s == b_s): + m.d.sync += [ + tot.eq(a_m + b_m), + z_s.eq(a_s) + ] + # a mantissa greater than b, use a + with m.Else(a_m >= b_m): + m.d.sync += [ + tot.eq(a_m - b_m), + z_s.eq(a_s) ] + # b mantissa greater than a, use b + with m.Else(): + m.sync += [ + tot.eq(b_m - a_m), + z_s.eq(b_s) + ] return m """ -- 2.30.2