From 8570823645b26d03edc089d9fd18baac78efa872 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 15 Feb 2020 11:55:06 +0000 Subject: [PATCH] comment why shift mask exists --- src/ieee754/part_shift/part_shift_dynamic.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ieee754/part_shift/part_shift_dynamic.py b/src/ieee754/part_shift/part_shift_dynamic.py index 95f329ed..b298271f 100644 --- a/src/ieee754/part_shift/part_shift_dynamic.py +++ b/src/ieee754/part_shift/part_shift_dynamic.py @@ -55,6 +55,9 @@ class PartitionedDynamicShift(Elaboratable): min_bits = math.ceil(math.log2(intervals[0][1] - intervals[0][0])) max_bits = math.ceil(math.log2(width)) + # shifts are normally done as (e.g. for 32 bit) result = a & (b&0b11111) + # truncating the b input. however here of course the size of the + # partition varies dynamically. shifter_masks = [] for i in range(len(b_intervals)): mask = Signal(b_intervals[i].shape(), name="shift_mask%d" % i) -- 2.30.2