/1/And.hdl

http://github.com/happy4crazy/elements_of_computing_systems · Unknown · 19 lines · 15 code · 4 blank · 0 comment · 0 complexity · f475dd4f0b15f182cee2956b9fdd851d MD5 · raw file

  1. // This file is part of the materials accompanying the book
  2. // "The Elements of Computing Systems" by Nisan and Schocken,
  3. // MIT Press. Book site: www.idc.ac.il/tecs
  4. // File name: projects/01/And.hdl
  5. /**
  6. * And gate: out = a and b.
  7. */
  8. CHIP And {
  9. IN a, b;
  10. OUT out;
  11. PARTS:
  12. Nand(a=a, b=b, out=left);
  13. Nand(a=a, b=b, out=right);
  14. Nand(a=left, b=right, out=out);
  15. }