5

i'm not too sure why my Nand2tetris simulator keep telling me line 3 error. can anyone tell me any problem with the following code:

CHIP Xor {
    IN a, b;
    OUT out;

    PARTS:
    Not(in=a, out=nota);
    Not(in=b, out=notb);
    And(a=a, b=notb, out=m);
    And(a=nota, b=b, out=n);
    Or(a=m, b=n, out=out);
}
zubergu
  • 3,646
  • 3
  • 25
  • 38
  • I'm not too sure why suddenly it works. It doesn't seem to be the code issue. Or maybe Nand2Tetris simulator not working well? hmm – Steven Meow De Claude May 25 '15 at 16:36
  • Are you following along with Module 1, Lecture 5? If so, you'll find the file that Noam is using in the lecture in the "demo" folder, not the 01 folder. – Mailbox Apr 19 '23 at 00:25

2 Answers2

11

Place your file in the Project00 directory where there is no other chipset; if it (the Xor.hdl file) is in another directory the simulator will attempt to use other chips in your folder. It is likely those chips are merely skeletons still waiting to be "functioning" via your design implementation thus your chip will not load nor will it allow you to eval (-uate) any data.

Cretin
  • 111
  • 1
  • 5
3

I just had this same issue. I had to move the HDL, TST and CMP files into a separate directory and rerun.

RickNG
  • 31
  • 5