Login  Register

projects/01/Xor.hdl

Posted by leder on Jul 21, 2021; 2:36pm
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/projects-01-Xor-hdl-tp4036162.html

Hi all,

the demo/Xor.hdl compiles well, but when I edit the 01/Xor.hdl to exactly the same contents:

CHIP Xor {
    IN a, b;
    OUT out;

    PARTS:
    Not (in=a, out=nota);
    Not (in=b, out=notb);
    And (a=a, b=notb, out=x);
    And (a=nota, b=b, out=y);
    Or (a=x, b=y, out=out);
}

I get the compiler error:

leder@home-ryzen:~/nand2tetris/projects/01$ HardwareSimulator Xor.hdl
In script /home/leder/nand2tetris/projects/01/Xor.hdl, Line 12, Illegal terminator: '{'