/* Add1 circuit */

#include "Sim.h"

void simnet()
{
   Signal sw0, sw1, out;
   Signal not_sw0, not_sw1;
   Signal and_1, and_2a, and_2b, and_3a, and_3b;
   Signal o0, o1;

   Switch ( "aa", sw1, '1', Zero );
   Switch ( "ba", sw0, '0', Zero );


   Not ( "ab", sw1, not_sw1);
   Not ( "bb", sw0, not_sw0);

   /*------------------------- stage 1 ---------------------- */
   And ( "ac", (sw0,sw1),         and_1);
   
   And ( "bc", (not_sw1,sw0),     and_2a);
   And ( "bc", (sw1,not_sw0),     and_2b);
   
   And ( "cc", (sw1,not_sw0),     and_3a);
   And ( "cc", (not_sw1,not_sw0), and_3b);
   
   /*------------------------- stage 2 ---------------------- */
   
   Or ( "bd", (and_2a,and_2b),   o1);
   Or ( "cd", (and_3a,and_3b),   o0);
   
   /*------------------------- Probes ---------------------- */
    
   ProbeH ( "ae", (and_1,o1,o0));
/*
   Probe ( "ae", and_1);
   Probe ( "be", o1);
   Probe ( "ce", o0);
*/
}


