KoggeStone constructor
KoggeStone constructor
Implementation
KoggeStone(List<Logic> inps, Logic Function(Logic, Logic) op)
: super(inps, 'kogge_stone') {
final iseq = <Logic>[];
inps.forEachIndexed((i, el) {
iseq.add(addInput('i$i', el, width: el.width));
_oseq.add(addOutput('o$i', width: el.width));
});
var skip = 1;
while (skip < inps.length) {
for (var i = inps.length - 1; i >= skip; --i) {
iseq[i] = op(iseq[i - skip], iseq[i]);
}
skip *= 2;
}
iseq.forEachIndexed((i, el) {
_oseq[i] <= el;
});
}