Calculator icon in the Hardware simulator is greyed out on user's programs

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

Calculator icon in the Hardware simulator is greyed out on user's programs

stefano
I downloaded and installed the Nand2Tetris software from Github on an Archlinux installation and can successfully run the demo script Xor.hdl and test the chip with various inputs.
However, a (functionally) identical Xor.hdl script I wrote as a test fails to work. The calculator icon is always greyed out and changing the input values does not seem to have any effect on the values the simulator passes down to the logical gates.

It seems as if the simulator is not properly loading the script, but no error message is displayed

I have tried different jre's (both  Oracle's and openjdk), to no avail. I am enclosing my simple Xor.hdl script I wrote below.

Help is appreciated.

Stefano

P. S.
I posted a similar message a few days ago on the Coursera's course website but I haven't received any reply, so I'm reposting it here.

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

/**
* Exclusive-or gate:
* out = not (a == b)
*/

CHIP Xor {
  IN a, b;
  OUT out;

  PARTS:
  Not (in=a, out=nota);
  Not (in=b, out=notb);
  And (a=a,b=notb,out=aAndNotb);
  And (a=nota, b=b, out=notaAndb);
  Or (a=aAndNotb, b=notaAndb, out=out);
}
Reply | Threaded
Open this post in threaded view
|

Re: Calculator icon in the Hardware simulator is greyed out on user's programs

WBahn
Administrator
Does your folder have .hdl files for the other gates (the Not, And, and Or)?

If so, and if those files do not have an implementation in them, then the simulator can't simulate the logic they represent.

If you move/delete/rename those files then the simulator will use the built-in Java models for those gates. My guess is that is what is happening when you run the Xor.hdl demo.
Reply | Threaded
Open this post in threaded view
|

Re: Calculator icon in the Hardware simulator is greyed out on user's programs

stefano
Silly me!

That's exactly what happened of course. I may have been thrown off track by one of the lectures, where he teacher says to look for the Xor.hdl script in the projects/01 dire---which is where all the stubs for the first assignments are.  

Anyways, my bad---I should have paid more attention to the description of the the simulator's search strategy.

Cheers and thanks,

Stefano