harware simulator

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

harware simulator

Marie
I can't load my script in the simulator. always have message chip load but never appear. i try changing name and have an error message. So i don't know what to do next, and it's my first chip Not. So don't look good to me am I so..... help please  thank you
Reply | Threaded
Open this post in threaded view
|

Re: harware simulator

cadet1620
Administrator
Marie wrote
I can't load my script in the simulator. always have message chip load but never appear.
The most common reason for the Hardware Simulator to hang while loading an HDL file is because that file tries to use the part it is defining in its PARTS section. This is a common error when starting to learn the HDL.

This, or a Java stack overflow, can also happen if you have a dependency loop—if part A uses part B which uses PartA.

I suspect that you have something like
CHIP Not {
    IN  in;
    OUT out;
    PARTS:
    Not(...
}

You can only use Nand parts when making your Not. Once you have Not working, then you can make And using Nand and Not, and so forth. Each chip you get working, you add to your toolbox of parts that can be used to build the next chip.

If you have not yet read it, check out the Hardware Construction Survival Kit.

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

Re: harware simulator

Marie
    PARTS:
 Not in=a,out=b;
 Not in=b,out=a;
that is my answer is it correct? i have the same message. don't know what to do next
Reply | Threaded
Open this post in threaded view
|

Re: harware simulator

ybakos
Marie,
Be sure to have spent time with chapter 1 of the book, and the relevant reading in the appendix. Hack HDL has a specific syntax, and what you wrote isn't valid HDL.

Furthermore, try to imagine that you are sitting at a workbench, trying to build a Not chip out of wires and Nand gates. You have Nand gates and wires; how would you connect them together to build a Not chip?

Reply | Threaded
Open this post in threaded view
|

Re: harware simulator

Marie
 Not(in=a,out=b);
 Not(in=b,out=a); and it still not working , do i have to put 0 and 1, i just can't figure it out. And i think i don't understand what Nand is exactly, my english is not perfect that doesn't help me. thank you for your help again. p.s. I had read all the doc. again.
Reply | Threaded
Open this post in threaded view
|

Re: harware simulator

ybakos
You're trying to build a Not chip out of Not chips. This isn't possible, since you don't have a Not chip - you're building one! All you have is Nand, at first. So build the Not chip out of what you have.
Reply | Threaded
Open this post in threaded view
|

Re: harware simulator

ceoj
I don't understand how you can make a Not chip out of Nand chips. Nand chips have two inputs, Not chips have one. This is frustrating. Any helpful tips would be appreciated.
Reply | Threaded
Open this post in threaded view
|

Re: harware simulator

ybakos
ceoj, Welcome to the forum!

Quick tip: start a new thread with your questions unless it is directly related to this.

As for your question... you're right: you're building a Not, and Not has one input and one output. All you have are Nand chips.... so how might you create a Not chip out of Nands?

See if this diagram helps you imagine this.



I feel that it is very important to be able to imagine, or perhaps draw, the chips that you are building.

Reply | Threaded
Open this post in threaded view
|

Re: harware simulator

ceoj
I get the concept , but I haven't found anything in the course material to explain how to combine two inputs into one, especially since the And and Or gates haven't been built yet.
Reply | Threaded
Open this post in threaded view
|

Re: harware simulator

ybakos
Did you read the book? Appendix A? Review the online slides?
Reply | Threaded
Open this post in threaded view
|

Re: harware simulator

cadet1620
Administrator
In reply to this post by ceoj
Since this is hardware, you can connect a chip input or internal wire to more than one part input, and you can connect a part output to more than one chip output or internal wire.

Also, experimentation is a valid strategy to get you started. You only have Nand to work with and a limited set of connections that can be made to its 'a' and 'b' inputs. Try all the variations and find the ones that work. Then figure out why they work.

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

Re: harware simulator

ceoj
OK, I got this. I was seriously just overthinking the whole thing.
Thanks much.
Reply | Threaded
Open this post in threaded view
|

Re: harware simulator

Paomal
In reply to this post by Marie
I have a problem: when I try to write in PARTS//put your code here.., nothing happens: I cannot write, but I don't have idea why. I simply loaded chip, but when i fix the cursor to start writing, it doesn't work.
Reply | Threaded
Open this post in threaded view
|

Re: harware simulator

WBahn
Administrator
The simulator is not an editor -- it is a simulator.

You need to edit your files using a text editor, such as Notepad or Notepad++. Virtually all operating systems have some kind of text editor that comes with it. You do NOT want to use a word processor, such as Word.
Reply | Threaded
Open this post in threaded view
|

Re: harware simulator

Paomal
Hanks I'll tra. But: after written on notepad, can I simulate the code? Where do I put my code?
Reply | Threaded
Open this post in threaded view
|

Re: harware simulator

WBahn
Administrator
You put your code in the text file.

You already have a template file for each part provided for you. Open that file in a text editor. Add your code. Save the file. Load that file into the simulator.


From: Paomal [via Nand2Tetris Questions and Answers Forum] <ml+[hidden email]>
Sent: Monday, April 27, 2020 2:42 PM
To: William Bahn <[hidden email]>
Subject: Re: harware simulator
 
Hanks I'll tra. But: after written on notepad, can I simulate the code? Where do I put my code?


If you reply to this email, your message will be added to the discussion below:
http://nand2tetris-questions-and-answers-forum.32033.n3.nabble.com/harware-simulator-tp4029613p4034496.html
To start a new topic under Hardware, email ml+[hidden email]
To unsubscribe from Nand2Tetris Questions and Answers Forum, click here.
NAML