Block Preview

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

IN_0 Input Variable bit BIT VECTOR
First input value for comparison. Width: Input Size (2 to 16384 bits) Interpretation depends on Sign property.
Default: Must be connected
IN_1 Input Variable bit BIT VECTOR
Second input value for comparison. Width: Input Size (2 to 16384 bits) Must have the same width as IN_0.
Default: Must be connected
OUT Output Variable bit BIT VECTOR
Output of the greater value. Equals IN_0 if IN_0 > IN_1, else equals IN_1. Width: Input Size (same as inputs)

Properties

Property window

Input Sign Sign

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

Input Size InputWordsize

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:

  1. Comparator to check IN_0 > IN_1
  2. 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