Combinatorial Logic

Purpose

Use binary input signals to select one row from truth table

Library

Control / Logical

Description

../../_images/combinatorial_logic.svg

The Combinatorial Logic block interprets its input as a vector of boolean values and outputs a row from the Truth table according to the input values. For an input vector of width \(n\), the truth table must have \(2^n\) rows and the row number is calculated as \(r = 1+\sum_i 2^{n-i} u_i\) where \(u_i = 1\) if the \(i\)-th input signal is greater than 0, \(u_i=0\) otherwise, i.e. the first element of the input vector is interpreted as the most significant bit and the \(n\)-th element as the least significant bit.

For example, when using a truth table

\[\begin{split}\left[\begin{array}{rr} 1.5 & 0\\ 4 & 2.5\\ 3 & 1.5\\ 5.5 & 0 \end{array}\right]\end{split}\]

the output is:

\[\begin{split}\begin{array}{ll} \mbox{Input}&\mbox{Output}\\ \left[0\:\:0\right] & \left[1.5\:\:0\right] \\ \left[0\:\:1\right] & \left[4\:\:2.5\right] \\ \left[1\:\:0\right] & \left[3\:\:1.5\right] \\ \left[1\:\:1\right] & \left[5.5\:\:0\right] \end{array}\end{split}\]

Parameters

Truth table

The truth table used to calculate the output. The table must have \(2^n\) rows, and \(n\) determines the width of the input signal. The number of columns determines the width of the output signal.

Probe Signals

Input

The input signals.

Output

The output signals.