FX GAIN TM
Time-multiplexed fixed-point gain/multiplier block implemented using Xilinx HLS. Multiplies TM data streams by a configurable fixed-point gain coefficient. Supports signed/unsigned arithmetic with independent bit width configuration for input, gain, and output (integer + fractional parts). Pipeline latency: 6 cycles.
Introduction
This block multiplies each sample of a time-multiplexed (TM) input stream by a fixed-point gain coefficient, producing a scaled output stream.
On every rising edge of CLK, if IN_DV = 1, the component performs:
$$ \mathrm{OUT}(n) = \mathrm{IN}(n) \times \mathrm{GAIN}, $$
where all operands are fixed-point numbers with configurable integer and fractional bit widths. The TM Factor property determines how many parallel samples are processed per clock cycle.
Pin Description
(IN Integer + IN Fraction) × TM Factor
Each TM phase receives its corresponding slice of the input bus.
GAIN Integer + GAIN Fraction
Applied to all TM phases. Can be connected to a register or constant.
(OUT Integer + OUT Fraction) × TM Factor
Valid data appear after 6 clock cycles from input.
Properties
Number of bits of the integer part of the input
Number of integer bits of the input signal ($I_\text{in}$). Range: 0 – 128. Together with IN Fraction, defines the input dynamic range and precision.Default: 16
Options: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
Number of bits of the fractional part of the input
Number of fractional bits of the input signal ($F_\text{in}$). Range: 0 – 128. Higher values provide better precision but increase bit width.Default: 0
Options: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
Select if the input is signed or unsigned. Sign uses 1 bit of the integer part
Arithmetic type of the input signal:
UNSIGNED→ Non-negative values only, range [0, 2^N - 1]SIGNED→ Two’s complement, range [-2^(N-1), 2^(N-1) - 1]
The sign bit uses 1 bit of the integer part.
Default: UNSIGNED
Options: UNSIGNED SIGNED
Number of bits of the integer part of the output
Number of integer bits of the output signal ($I_\text{out}$). Range: 0 – 128. Should be sized to prevent overflow: typically ≥ IN Integer + GAIN Integer.Default: 16
Options: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
Number of bits of the fractional part of the output
Number of fractional bits of the output signal ($F_\text{out}$). Range: 0 – 128. For full precision: Set to IN Fraction + GAIN Fraction. Can be reduced to save resources (introduces quantization).Default: 0
Options: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
Select if the output is signed or unsigned. Sign uses 1 bit of the integer part
Arithmetic type of the output signal:
UNSIGNED→ Unsigned resultSIGNED→ Signed result (required if input or gain are signed)
Default: UNSIGNED
Options: UNSIGNED SIGNED
Number of bits of the integer part of the gain
Number of integer bits of the gain coefficient ($I_\text{gain}$). Range: 0 – 128. Default: 2 (allows gain up to 4.0 in unsigned mode).Default: 2
Options: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
Number of bits of the fractional part of the gain
Number of fractional bits of the gain coefficient ($F_\text{gain}$). Range: 0 – 128. Default: 14 (provides precision of ~0.0001).Default: 14
Options: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
Select if the gain is signed or unsigned. Sign uses 1 bit of the integer part
Arithmetic type of the gain coefficient:
UNSIGNED→ Positive-only scaling (amplification)SIGNED→ Allows negative gains (inversion)
Default: UNSIGNED
Options: UNSIGNED SIGNED
Set number of samples for each clock cycle
Number of time-multiplexed phases (parallel samples per clock). Allowed values: 2, 4, 8, 16, 32. Higher values increase throughput proportionally but consume more FPGA resources (one HLS instance per TM factor).Default: 4
Options: 2 4 8 16 32
Functional description
The component implements fixed-point multiplication using Xilinx HLS (High-Level Synthesis) and replicates the operation N times (where N = TM Factor) to support time-multiplexed data streams with high throughput.
Fixed-point format
Each signal (IN, GAIN, OUT) is configured with:
- Integer bits: Number of bits for the integer part
- Fractional bits: Number of bits for the fractional part
- Sign: SIGNED or UNSIGNED arithmetic
Total bit width = Integer bits + Fractional bits.
Input modes
- IN: TM bus of width
(IN Integer + IN Fraction) × TM Factor - GAIN: Scalar fixed-point coefficient of width
GAIN Integer + GAIN Fraction - OUT: TM bus of width
(OUT Integer + OUT Fraction) × TM Factor
The GAIN input is not time-multiplexed and applies to all TM phases.
Data valid handshake
IN_DV(input): Input data valid signal, active highOUT_DV(output): Output data valid signal, active high (after 6 cycle latency)
Mathematical background
For fixed-point multiplication, given:
- Input $x$ with $I_x$ integer bits and $F_x$ fractional bits
- Gain $g$ with $I_g$ integer bits and $F_g$ fractional bits
The mathematical product is:
$$ y = x \times g = (x \cdot 2^{-F_x}) \times (g \cdot 2^{-F_g}) = (x \times g) \cdot 2^{-(F_x + F_g)} $$
The output format must accommodate the combined dynamic range. Typical configurations:
- Align fractional parts: Set OUT Fraction = IN Fraction + GAIN Fraction
- Prevent overflow: Set OUT Integer ≥ IN Integer + GAIN Integer
Timing
The HLS-generated IP has a fixed pipeline latency of 6 clock cycles:
| Property | Latency (clock cycles) |
|---|---|
| FX GAIN TM | 6 |
Total system delay: T_delay = 6 × T_CLK.
In TM mode, all phases operate in parallel with the same latency.
Typical use cases
- Signal amplitude scaling in ADC front-ends
- Programmable gain stages in nuclear/particle physics detectors
- Calibration and offset correction in multi-channel systems
- Digital filtering coefficient multiplication
Waveform example
Example with TM Factor = 4, Input = [100, 200, 300, 400], GAIN = 2.0 (fixed-point).
Note: 6 clock cycles of latency from input to output.