
#include "Sim.h"

void simnet()
{
   Signal inp, c1, c0;         // Input and control signals

   Signal not_c0, not_c1;

   Sig(out0, 1);
   Sig(out1, 1);
   Sig(out2, 1);
   Sig(out3, 1);

   Switch("ba", inp, '0', One);  // Input data

   Switch("fa", c1, '2', Zero);
   Switch("ga", c0, '1', Zero);

   Not("fb", c1, not_c1);
   Not("gb", c0, not_c0);
   
   And("ac", (inp, c1,     c0),     out3);
   And("bc", (inp, c1,     not_c0), out2);
   And("cc", (inp, not_c1, c0),     out1);
   And("dc", (inp, not_c1, not_c0), out0);
   
   Probe("ad", out3);
   Probe("bd", out2);
   Probe("cd", out1);
   Probe("dd", out0);
}



