Stumped - please help!

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

Stumped - please help!

Trtld
This post was updated on .
Hello, recently I have desired to learn of how a computer is built, and my research has led me to the Nand2Tetris course which so far I am finding quite informative. However, I have ran into a problem.
I am having trouble configuring the AND chip. When I run the simulator after loading the AND chip as well as the test script the Hardware Simulator displays an error. The error is as follows: "Unknown variable: a."
I have configured the NOT chip correctly, as far as I can tell. I have read Appendix A and the Hardware Construction Survival Kit, but I still cannot seem to find my problem.
This is the And.hdl file that I have modified:

    Removed

I would greatly appreciate any solutions to this problem I am having. Thank you!

P.S. I am sorry for asking this question which I'm sure you must answer rather frequently on these forums, but I couldn't seem to find a solution in the existing threads.
Reply | Threaded
Open this post in threaded view
|

Re: Stumped - please help!

cadet1620
Administrator
Trtld wrote
When I run the simulator after loading the AND chip as well as the test script the Hardware Simulator displays an error. The error is as follows: "Unknown variable: a."
This is the And.hdl file that I have modified:  

// 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/And.hdl

CHIP And {
    IN in1, in2;
    OUT out1;

    PARTS:
...
 
You are getting this error because you changed the IN and OUT pin names.

The test file expects the names to be "a", "b" and "out", so your file must say
CHIP And {
    IN a, b;
    OUT out;

The structure of your And is otherwise correct.

--Mark

[Please edit your post to remove the PARTS section. We want other students to develop their own solutions, too.]
Reply | Threaded
Open this post in threaded view
|

Re: Stumped - please help!

Trtld
Thank you very much, that worked!