/* Mux macro
*/

Define MyMux i3 i2 i1 i0 c1 c0 | out;

  Not    aa c0   not_c0;
  Not    aa c1   not_c1;

  And aa i3     c0     c1   out_3;
  And aa i2     c0 not_c1   out_2;
  And aa i1 not_c0     c1   out_1;
  And aa i0 not_c0 not_c1   out_0;

  Or  aa out_3 out_2 out_1 out_0   out;

Endef;

Switch 4a sw0 '0' ZERO;
Switch 3a sw1 '1' ZERO;
Switch 2a sw2 '2' ZERO;
Switch 1a sw3 '3' ZERO;

Switch 7a sw4 '4' ZERO;
Switch 8a sw5 '5' ZERO;

MyMux 3c-5c sw3 sw2 sw1 sw0 sw5 sw4 | or_out;

Probe 3e or_out;
