Not chip?

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

Not chip?

Mike
So, I just started the project and was able to get the code for the Not chip using only one line of Nand and I can't get it to work.
Here's my code,

Nand (a=in, b=in, out=out)

Please tell me what I'm doing wrong.
Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Not chip?

cadet1620
Administrator
This is correct code. In what manner is it not working?

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Not chip?

Mike
When I load the script, it says that there is a comparison error in line 2.
If this is not signifying a problem with my work, what is it signifying then?
Reply | Threaded
Open this post in threaded view
|

Re: Not chip?

cadet1620
Administrator
A few things to check:

1) Your Not.hdl must be in the same directory as the Not.tst file you are loading.
2) Make sure that you don't have a Nand.hdl file in your directory. Some people flail around a bit getting started and leave an empty Nand.hdl laying around.

If you can't get it working, email me your Not.hdl, .tst, .cmp, and .out files to


--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Not chip?

Mike
So after looking into this furter, I noticed that in all chips, even the ones copied from the book, used in the HS, the output always stays on 0. Is this a problem with the simulator itself?
Reply | Threaded
Open this post in threaded view
|

Re: Not chip?

cadet1620
Administrator
This is extremely unlikely to be a Hardware Simulator problem; it hasn't changed since Nov 2006.

Make sure that you are working directly in the Nand2Tetris/projects/01 directory (folder). This directory should contain all the skeleton .hdl files and all the .tst and .cmp files.  If you made a myChips subdirectory, or the like, it will not work because the test files load the .hdl file from their own directory.

It is very important that you implement the chips in the odrer listed in the book.  If you try to build Or before you build and test Not, it will not work because the And chip requires the Not chip to be working. For this reason I would expect that you would see all of the chips not working when you copied code from the book.

Be certain that you don't have a Nand.hdl of any sort in your directory. Nand is a built in primitive and any attempt to make one yourself will cause Not to fail.

If you have not yet read it, read The Hardware Construction Survival Kit.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Not chip?

Mike
Ok, I got it to work, I didn't relize having a myChips folder would be a problem.
Thanks for the help!