<< JKFLIPFLOP Integer_pal SHIFT >>

Scilab Help >> Xcos > palettes > Integer_pal > LOGIC

LOGIC

Combinatorial Logic

Block Screenshot

Contents

Description

This block implements a standard truth table for modeling programming array, digital circuit and any other boolean expressions.

The user must specify a matrix that defines all the possible block outputs in the Truth Table field. In consequence, the number of rows must be a power of two. Each row of the matrix contains a logic combination of input elements.

Setting the parameter Truth Table defines the number of inputs and outputs in the following way :

This block can be activated by an implicit input event or it can inherit the clock from the regular input (parameter Accepts Inherited Events).

Data types

The block supports the following types :

Parameters

Default properties

Examples

Example 1

The easiest example to consider is the OR example.In this case we have two inputs and only one output. The truth table for this example is :

input 1 input 2 output
000
011
101
111

and the Truth Table parameter is writing [0 ; 1 ; 1 ; 1].

Example 2

This example shows the use of LOGIC bloc as a demultiplexer. The goal is to send the true constant input on one of the four outputs according to the state of the two selection inputs: a and b. The truth table is the following:

Constant a b Q0 Q1 Q2 Q3
0XX0000
1001000
1010100
1100010
1110001

where X stands for "indifferent".

To set this table in the Truth Table parameter, we can simply write:

[zeros(4,4) ; eye(4,4)]

The following figure shows the resulting outputs Q0 to Q3 during the simulation when the selection inputs a and b are generated by a binary counter.

Interfacing function

Computational function

See also


Report an issue
<< JKFLIPFLOP Integer_pal SHIFT >>