building chips

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

building chips

mdhELT
I have found that doing any edits to the Not.hdl file prevents it from loading in the HWsimulator.
Error message - Cip in is not found in the working and built in folders.
However, if I simply delete the edits, the file then loads.
Seems to defeat the idea of building our own chip versions.
Reply | Threaded
Open this post in threaded view
|

Re: building chips

WBahn
Administrator
Post the contents of the file after your edits and we'll see if we can help you figure it out.
Reply | Threaded
Open this post in threaded view
|

Re: building chips

mdhELT
// 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/01/Not.hdl

/**
 * Not gate:
 * out = not in
 */

CHIP Not {
    IN in;
    OUT out;

    PARTS:
    // Put your code here:

        a = in;
}

I made this trivial edit just to experiment with my loading problem. When I deleted this single line, the file loaded successfully.
Reply | Threaded
Open this post in threaded view
|

Re: building chips

WBahn
Administrator
The problem is that your simple edit is not valid HDL code and the emulator validates the file when it tries to load it. So it's not loading successfully.

What the emulator does not do a very good job of is providing good feedback on why a particular file is invalid.

The code needs to consist of a list of parts and how they are connected. At this point, the only part you have available is the Nand gate. Once you have the Not successfully implemented, your next part can use both Nand and Not gates, and so on.

The Nand gate has two input ports, labeled a and b, and one output, labeled out.

Try the following as your test code

Nand(a=false, b=in, out=out);
Reply | Threaded
Open this post in threaded view
|

Re: building chips

mdhELT
Thanks for the HDL Rosetta stone. I should have it from here. I successfully built and tested some chips - including corrected Not.
Reply | Threaded
Open this post in threaded view
|

Re: building chips

WBahn
Administrator
If you haven't looked at it yet, check out the HDL Survival Guide