MODULE audimux2;

TITLE 'Ausgangsmultiplexer fuer digitalen Vorverstaerker'

IC312 DEVICE 'P16V8';

DECLARATIONS;
     ain, bin, lin, xin, yin         PIN 9, 8, 11, 19, 17;
     out1, out2, lout, xout, yout    PIN 13, 14, 12, 18, 16 ISTYPE 'COM';
     qmux0, qmux1, qmux2, qmux3      PIN 5, 2, 3, 1;

     qmux  = [qmux3 .. qmux0];


EQUATIONS;
     " Ausgangsmultiplexer                    Fkt. Ausg. 1   Fkt. Ausg. 2
     when (qmux == 0) then
          [out1, out2, xout, yout, lout]      "   direkt         direkt
        = [ain,  bin,  ain,  ain,  bin];

     when (qmux == 1) then
          [out1, out2, xout, yout, lout]      "    Loop          direkt
        = [lin,  bin,  ain,  ain,  ain];

     when (qmux == 4) then
          [out1, out2, xout, yout, lout]      "   direkt          Loop
        = [ain,  lin,  bin,  bin,  bin];

     when (qmux == 6) then
          [out1, out2, xout, yout, lout]      "   direkt        Option 1
        = [ain,  xin,  bin,  bin,  ain];

     when (qmux == 7) then
          [out1, out2, xout, yout, lout]      "    Loop         Option 1
        = [lin,  xin,  ain,  ain,  ain];

     when (qmux == 11) then
          [out1, out2, xout, yout, lout]      "   direkt       Loop+Opt.1
        = [ain,  lin,  bin,  bin,  xin];

     when (qmux == 2) then
          [out1, out2, xout, yout, lout]      "  Option 1        direkt
        = [xin,  bin,  ain,  ain,  bin];

     when (qmux == 3) then
          [out1, out2, xout, yout, lout]      " Loop+Opt.1       direkt
        = [lin,  bin,  ain,  ain,  xin];

     when (qmux == 5) then
          [out1, out2, xout, yout, lout]      "  Option 1         Loop
        = [xin,  lin,  ain,  ain,  bin];

     when (qmux == 10) then
          [out1, out2, xout, yout, lout]      "  Option 1       Option 2
        = [xin,  yin,  ain,  bin,  ain];

     when (qmux == 9) then
          [out1, out2, xout, yout, lout]      " Loop+Opt.1      Option 2
        = [lin,  yin,  ain,  bin,  xin];

     when (qmux == 8) then
          [out1, out2, xout, yout, lout]      "  Option 1      Loop+Opt.2
        = [xin,  lin,  ain,  bin,  yin];

END audimux2;

