FixedPointValue constructor
- required LogicValue value,
- required bool signed,
- required int m,
- required int n,
Constructs FixedPointValue from sign, integer and fraction values.
Implementation
FixedPointValue(
{required this.value,
required this.signed,
required this.m,
required this.n}) {
if (value == LogicValue.empty) {
throw RohdHclException('Zero width is not allowed.');
}
final w = signed ? m + n + 1 : m + n;
if (w != value.width) {
throw RohdHclException('Width must be (sign) + m + n.');
}
}