ParallelPrefixIncr constructor
Increment constructor
Implementation
ParallelPrefixIncr(Logic inp,
{ParallelPrefix Function(List<Logic>, Logic Function(Logic, Logic))
ppGen = KoggeStone.new,
super.name = 'parallel_prefix_incr'}) {
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());
}