Login  Register

Chip has a circle in it's parts? Xor.hdl issues

Posted by Zhme on Dec 11, 2020; 11:22am
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/Chip-has-a-circle-in-it-s-parts-Xor-hdl-issues-tp4035304.html

I am getting an error "This chip has a circle in it's parts connections: load Xor.hdl".

My code:

CHIP Xor {
    IN a, b;
    OUT out;

    PARTS:
    Nand(a=a, b=a, out=outa);
    Nand(a=b, b=b, out=outb);
    Nand(a=a, b=notb, out=outanda);
    Nand(a=nota, b=b, out=outandb);
    Nand(a=outanda, b=outanda, out=nota);
    Nand(a=outandb, b=outandb, out=notb);
    Nand(a=nota, b=notb, out=out);
}

I assumed that, noting the title of the course, we should attempt to write each basic gate from a flow built with nand gates alone.

After seeing this error message I wonder if maybe I just needed to see how the most basic of gates could be built with nand alone, and to use the gates that I've built to slowly build more advanced gates?

I wonder if the reason for my error is that I assigned the initial inputs in more than one location? If so, how would I remedy this error and still use this convoluted approach? Thank you in advance for any support given!