Documentation

Combinatorial Logic

Implement truth table

  • 库:
  • Simulink / Logic and Bit Operations

Description

The Combinatorial Logic block implements a standard truth table for modeling programmable logic arrays (PLAs), logic circuits, decision tables, and other Boolean expressions.You can use this block in conjunction with内存鼓风机cks to implement finite-state machines or flip-flops.

Ports

Input

expand all

Input signal, specified as a vector. The type of signals accepted by aCombinatorial Logic鼓风机ck depends on whether you selected the Boolean logic signals option (seeImplement logic signals as Boolean data (vs. double)). If this option is enabled, the block accepts real signals of typeBooleanordouble.

Data Types:double|Boolean

Output

expand all

Output signal,doubleif the truth table contains non-Boolean values of typedouble;Booleanotherwise. The type of the output is the same as that of the input except that the block outputsdoubleif the input isBooleanand the truth table contains non-Boolean values.

Data Types:double|Boolean

Parameters

expand all

你指定一个矩阵,它定义了所有可能的车辆ck outputs as theTruth tableparameter. Each row of the matrix contains the output for a different combination of input elements. You must specify outputs for every combination of inputs. The number of columns is the number of block outputs.

TheTruth tableparameter can have Boolean values (0 or 1) of any data type, including fixed-point data types. If the table contains non-Boolean values, the data type of the table must bedouble.

The relationship between the number of inputs and the number of rows is:

number of rows = 2(number of inputs)

万博1manbetx®returns a row of the matrix by computing the row's index from the input vector elements. Simulink computes the index by building a binary number where input vector elements having zero values are 0 and elements having nonzero values are 1, then adding 1 to the result. For an input vector,u, ofmelements:

row index = 1 + u(m)*20+ u(m-1)*21+ ... + u(1)*2m-1

Programmatic Use

Block Parameter:TruthTable
Type: character vector
Values: matrix
Default:'[0 0;0 1;0 1;1 0;0 1;1 0;1 0;1 1]'

Block Characteristics

Data Types

double|Boolean

Multidimensional Signals

No

Variable-Size Signals

No

Introduced before R2006a

Was this topic helpful?