think of them like building blocks... you need bricks to build a wall, and walls to build a room, several rooms to build a house, etc. -- you can't build a house with a house, you have to first use the more fundamental parts to build it up.
Since we're treating NAND as the most fundamental element, then we can use it to build all our other parts.
Then assuming you've figured out how to build a NOT gate from NAND(s), then now you can use both NANDs and NOTs to build the next level up, the AND gate.
markuk wrote
This is what I've got so far:
CHIP And {
IN a, b;
OUT out;
PARTS:
// Put your code here:
Nand(in=a, in=b, out=out);
}
What you've got so far, is a chip named AND, but it functions exactly like an NAND (because that's the only part you've used)
Think about the truth tables... an NAND is just a NOT(AND), so that makes an AND what...? a NOT(NAND), right?
Then its just a matter of chaining your outputs of one into the inputs of the other.
Hope this helps.