zeroExtend method
- int newWidth
Returns a new Logic with width newWidth
where new bits added are zeros
as the most significant bits.
The newWidth
must be greater than or equal to the current width or an
exception will be thrown.
If isNet, then the result will also be a net.
Implementation
Logic zeroExtend(int newWidth) {
if (newWidth < width) {
throw Exception(
'New width $newWidth must be greater than or equal to width $width.');
}
return [
Const(0, width: newWidth - width),
this,
].swizzle();
}