From: Luke Kenneth Casson Leighton Date: Sat, 15 Feb 2020 11:55:06 +0000 (+0000) Subject: comment why shift mask exists X-Git-Tag: ls180-24jan2020~167 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8570823645b26d03edc089d9fd18baac78efa872;p=ieee754fpu.git comment why shift mask exists --- 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)