FloatingPointSortByExp<FpType extends FloatingPoint> constructor
Constructs a FloatingPointSortByExp module that sorts two floating point values so that the one with the larger exponent is first.
Implementation
FloatingPointSortByExp(
super.a,
super.b, {
super.metaA,
super.metaB,
super.name = 'floating_point_sort_by_exp',
super.reserveName,
super.reserveDefinitionName,
String? definitionName,
}) : super(
definitionName:
definitionName ?? 'FloatingPointSortByExp_W${a.width}') {
final (sorted: (larger, smaller), didSwap: doSwap) =
FloatingPointUtilities.sortByExp((super.a, super.b));
output('outA') <= larger;
output('outB') <= smaller;
if ((metaA != null) & (metaB != null)) {
final (swapMetaA, swapMetaB) = swap(doSwap, (super.metaA!, super.metaB!));
output('outMetaA') <= swapMetaA;
output('outMetaB') <= swapMetaB;
}
}