Select Greater
Selects and outputs the greater of two input values. Pure combinational comparator that passes through the maximum value. Supports both signed and unsigned comparison with zero latency.
Introduction
This block compares two input values and outputs the greater one. It combines comparison and selection in a single component:
$$ \mathrm{OUT} = \max(\mathrm{IN_0}, \mathrm{IN_1}) $$
Unlike boolean comparators that output a 1-bit result, this component outputs the full value of the greater 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 Greater component performs a maximum operation between two inputs. It compares IN_0 and IN_1, then routes the larger 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 = 0xFF (255)
SIGNED mode:
- IN_0 = 0xFF (-1), IN_1 = 0x01 (1) → OUT = 0x01 (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 Greater | 0 |
The component has zero latency (purely combinational).
Typical use cases
- Finding maximum of two values
- Peak tracking and envelope detection
- Building larger maximum-finding trees
- Limiting signals to minimum thresholds
- Selection logic in control paths