From 4884f6fae51c126c07eb49300b61ea0ef8fec15d Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 14 Feb 2019 09:05:21 +0000 Subject: [PATCH] add in comments on add 2nd stage --- src/add/nmigen_add_experiment.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/add/nmigen_add_experiment.py b/src/add/nmigen_add_experiment.py index 991335c9..fc06092c 100644 --- a/src/add/nmigen_add_experiment.py +++ b/src/add/nmigen_add_experiment.py @@ -232,9 +232,12 @@ class FPADD: z_s.eq(b_s) ] + # ****** + # Second stage of add: preparation for normalisation + with m.State("add_1"): m.next = "normalise_1" - + # tot[27] gets set when the sum overflows. shift result down with m.If(tot[27]): m.d.sync += [ z_m.eq(tot[4:28]), @@ -243,7 +246,7 @@ class FPADD: sticky.eq(tot[1] | tot[0]), z_e.eq(z_e + 1) ] - + # tot[27] zero case with m.Else(): m.d.sync += [ z_m.eq(tot[3:27]), -- 2.30.2