getEncoding method

RadixEncode getEncoding(
  1. int row
)

Retrieve the Booth encoding for the row

Implementation

RadixEncode getEncoding(int row) {
  if (row >= rows) {
    throw RohdHclException('row $row is not < number of encoding rows $rows');
  }
  final base = row * log2Ceil(_encoder.radix);
  final multiplierSlice = [
    if (row > 0)
      _extendedMultiplier.slice(base + log2Ceil(_encoder.radix) - 1, base - 1)
    else
      [
        _extendedMultiplier.slice(base + log2Ceil(_encoder.radix) - 1, base),
        Const(0)
      ].swizzle()
  ];
  return _encoder.encode(multiplierSlice.first);
}