Truth Tables : Executing Truth Tables : Factorization of Cells : Factorizing Inputs

Factorizing Inputs

While factorization of inputs is a labor saving device, it also affects the logic of the table and how it is implemented in code. The table is evaluated from top to bottom, and from left to right. The generated code, as well as the simulator, matches this behavior.

Here is an example of factorization:

 

This is the resulting logic, shown as pseudo-code:

if CO_1 then
if CO_2 then
if DI_1=1 and REC_1=REC_2 and ARR_1 = {1,2,3} then
tr!(CON_3); DATA_2:=100;
else
if DI_1=2 then
tr!(CON_3); DATA_2:=-1;
else
if DI_1=3 then
tr!(CON_3); DATA_2:=1;
else
if DI_1=5 then
tr!(CON_3); DATA_2:=2;
else
fs!(CON_3); DATA_2:=0;

Note that factorization of inputs is allowed from left to right only. Reading from left to right, each subsequent factorization of inputs must be a subset of all those to the left, as this example illustrates.

The next two examples show incorrect implementations of factorization to further illustrate the points explained above.

Incorrect factorization - Example 1:

 

Note that in this example, input column 2 is a subset of input column 1, and this is not allowed.

Incorrect factorization - Example 2:

 

Note that in this example, column 2 was not built so that each factorization is a subset of all those to the left of it.