1.3.1 Defining Truth Tables

Sometimes the clearest way to express logic descriptions is in tables of information. CUPL provides the TABLE keyword to create tables of information. First, define relevant input and output variable lists, and then specify one-to-one assignments between decoded values of the input and output variable lists. “Don’t care” values are supported for the input decode value, but not for the output decoded value.

A list of input values can be specified to make multiple assignments in a single statement. The following block describes a simple hex-to-BCD code converter:
FIELD input = [in3..0];
FIELD output = [out3..0];
TABLE input => output {
0=> 00; 1=>01; 2=>02; 3=>03;
4=>04; 5=>05; 6=>06; 7=>07;
8=>08; 9=>09; A=>10; B=>11;
C=>12; D=>13; E=>14; F=>15;
}