I have used the Nand gate as primitive as indicated by the book that all should be built from the Nand gate.
Here is my HDL file: Please anyone Help.
// This file is part of www.nand2tetris.org
// and the book "The Elements of Computing Systems"
// by Nisan and Schocken, MIT Press.
// File name: projects/1/And.hdl
/**
* And gate:
* if (a and b) out = 1, else out = 0
* here a and b are 1 bit pins
*/
CHIP And {
IN a, b;
OUT out;
PARTS:
//// Replace this comment with your code.
//// Function: if ((a==1) and (b==1)) then out = 1, else out = 0
Nand (a=a, b=b, out=w1);
Not (a=w1, out=out);
}
John