/*
   Full Adder circuit
*/

Define Full_Adder CarryIn a b | CarryOut Sum;
  Xor aa a b x;
  Xor ab x CarryIn Sum;
  And bb a b y;
  And cb CarryIn x z;
  Or bc-cc y z CarryOut;
Endef;

/* ------------------------- */
Switch aa Cin '0' ZERO;
Switch ca a   '1' ZERO;
Switch da b   '2' ZERO;
Full_Adder ab-ed Cin a b | Cout sum;
Probe ae Cout;
Probe de sum;
