Select Smaller
Selects and outputs the smaller of two input values. Pure combinational comparator that passes through the minimum value. Supports both signed and unsigned comparison with zero latency.
Introduction
This block compares two input values and outputs the smaller one. It combines comparison and selection in a single component:
$$ \mathrm{OUT} = \min(\mathrm{IN_0}, \mathrm{IN_1}) $$
Unlike boolean comparators that output a 1-bit result, this component outputs the full value of the smaller input.
Pin Description
Properties
Select if input is signed or unsigned
Selects input interpretation for comparison: UNSIGNED (default, treats values as positive binary) or SIGNED (two’s complement, supports negative values).Default: UNSIGNED
Options: UNSIGNED SIGNED
Set the size in bit of inputs
Number of bits for both inputs and output. Range: 2-16384 bits. All ports must have the same width.Default: 16
Range: 2 – 16384
Functional description
The Select Smaller component performs a minimum operation between two inputs. It compares IN_0 and IN_1, then routes the smaller value to the output.
Operation
$$ \mathrm{OUT} = \begin{cases} \mathrm{IN_0} & \text{if } \mathrm{IN_0} < \mathrm{IN_1} \ \mathrm{IN_1} & \text{otherwise} \end{cases} $$
When IN_0 equals IN_1, IN_1 is selected (deterministic behavior).
Signed vs. Unsigned
The Sign property determines how values are compared:
- UNSIGNED: Standard binary comparison (0 to 2^N - 1)
- SIGNED: Two’s complement comparison (-2^(N-1) to 2^(N-1) - 1)
Example (8-bit)
UNSIGNED mode:
- IN_0 = 0xFF (255), IN_1 = 0x01 (1) → OUT = 0x01 (1)
SIGNED mode:
- IN_0 = 0xFF (-1), IN_1 = 0x01 (1) → OUT = 0xFF (-1)
Implementation
This is a purely combinational component implemented as:
- Comparator to check IN_0 < IN_1
- Multiplexer to select the appropriate input based on comparison result
Latency and Timing
| Property | Latency (clock cycles) |
|---|---|
| Select Smaller | 0 |
The component has zero latency (purely combinational).
Typical use cases
- Finding minimum of two values
- Valley tracking and envelope detection
- Building larger minimum-finding trees
- Limiting signals to maximum thresholds
- Selection logic in control paths