b_asic.data_type¶

B-ASIC Data Type Module.
- class b_asic.data_type.DataType(wl: int | tuple[int, int], input_wl: int | tuple[int, int] | None = None, output_wl: int | tuple[int, int] | None = None, num_repr: NumRepresentation = NumRepresentation.FIXED_POINT, is_signed: bool = True, is_complex: bool = False, quantization_mode: QuantizationMode = QuantizationMode.TRUNCATION, overflow_mode: OverflowMode = OverflowMode.WRAPPING)¶
Data type specification.
All arguments are keyword only.
The number of bits can be specified in two few different ways.
num_repr
int
(int, int)
(1, wl -1), one integer bits, wl bits in total
(integer bits, fractional bits)
N/A
(exponent bits, mantissa bits)
If input_wl or output_wl are not provided, they are assumed to be the same as wl.
- Parameters:
- wlint or (int, int)
Number of bits for data type used in computations.
- input_wlint or (int, int), optional
Number of bits for input data type.
- output_wlint or (int, int), optional
Number of bits for output data type.
- num_repr
NumRepresentation, default:NumRepresentation.FIXED_POINT Type of number representation to use.
- is_signedbool, default: True
If the number representation is signed.
- is_complexbool, default: False
If the number representation is complex-valued.
- quantization_mode
QuantizationMode, default:QuantizationMode.TRUNCATION Type of quantization to use.
- overflow_mode
OverflowMode, default:OverflowMode.WRAPPING Type of overflow to use.