binary static method
- LogicValue value, {
- int? width,
Binary bits, optionally zero-extended, with no integer-width limitation.
Implementation
static String binary(LogicValue value, {int? width}) {
final targetWidth = width ?? value.width;
if (targetWidth <= 0 || targetWidth < value.width) {
throw ArgumentError.value(targetWidth, 'width',
'Must be positive and at least the value width.');
}
return value
.toString(includeWidth: false)
.toLowerCase()
.padLeft(targetWidth, '0');
}