element method
Builds an integer lane or a fractional lane retaining its Q schema.
Implementation
Logic element({String? name, bool signed = true}) {
if (fractionBitsKnob.value >= widthKnob.value) {
throw ArgumentError('Fraction bits must be smaller than total width.');
}
if (fractionBitsKnob.value == 0) {
return Logic(name: name, width: widthKnob.value);
}
return FixedPoint(
integerWidth: widthKnob.value - fractionBitsKnob.value - (signed ? 1 : 0),
fractionWidth: fractionBitsKnob.value,
signed: signed,
name: name,
);
}