bwukki

Untitled

Nov 20th, 2017
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. /**
  2. * Exclusive-or gate:
  3. * out = not (a == b)
  4. */
  5.  
  6. CHIP Xor {
  7. IN a, b;
  8. OUT out;
  9.  
  10. PARTS:
  11. Nand(a=a, b=b, out = i);
  12.  
  13. Nand(a=a, b=a, out = na);
  14. Nand(a=b, b=b, out = nb);
  15. Nand(a=na, b=nb, out = j);
  16.  
  17. Nand(a = i, b = j, out = q);
  18. Nand(a = q, b = q, out = out);
  19. }
Add Comment
Please, Sign In to add comment