/* Illustrate macro facility */

/* Define macro */
Define Decoder2x4 c[1..0] | s[3..0];
  Not  aa   c[1]    not-c1;
  Not  ba   c[0]    not-c0;
  And  ba   c[1]    c[0]     s[3];
  And  bb   c[1]    not-c0   s[2];
  And  bc   not-c1  c[0]     s[1];
  And  bd   not-c1  not-c0   s[0];
Endef;


/* Put up control switches */
Switch "0:c0" ca.ba x0 ZERO;
Switch "1:c1" ca.aa x1 ZERO;

/* Illustrate the use of Decoder2x4 macro: */
Decoder2x4 ab-bb x1 x0 | y3 y2 y1 y0;

/* Put up Probes for the outputs */
Probe ac-bc y3;
Probe ac-bc y2;
Probe ac-bc y1;
Probe ac-bc y0;
