ParallelPrefixDecr constructor
Decrement constructor
Implementation
ParallelPrefixDecr(Logic inp,
{ParallelPrefix Function(List<Logic>, Logic Function(Logic, Logic))
ppGen = KoggeStone.new,
super.name = 'parallel_prefix_decr'}) {
inp = addInput('inp', inp, width: inp.width);
final u = ppGen((~inp).elements, (lhs, rhs) => rhs & lhs);
addOutput('out', width: inp.width) <=
(List<Logic>.generate(
inp.width, (i) => ((i == 0) ? ~inp[i] : inp[i] ^ u.val[i - 1]))
.rswizzle());
}