Not16 failure in building the ALU

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

Not16 failure in building the ALU

Becca
I am building the ALU but keep running into a problem where the Not16 gate seems to fail.  I have Not16(in=x, out=notx), but when I test it on the Hardware Simulator, notx is always equal to -1, regardless of what x is set equal to.  

I checked and I do not have the Not16 hdl file in my project folder, which I know could be interferring with the implementation of the builtin.  Does anyone have any ideas for why this test is failing?

Thank you!
Reply | Threaded
Open this post in threaded view
|

Re: Not16 failure in building the ALU

cadet1620
Administrator
Are you hitting the "eval" button after changing x?

If you like, email me your ALU.hdl to cadet1620 a t pobox.com and I'll see if I can tell what's going on.

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

Re: Not16 failure in building the ALU

Becca
Hi Mark,

To try and identify the problem, I actually cut everything out of my ALU program except for the Not16 gate (   Not16(in=x, out=notx);).  I am testing it by reloading the file in the Hardware Simulator and then running the test file.  It evaluates notx as -1 when x is 0 (as it should), but continues to output notx as -1 even when x is changed (in the test) to 17.  

If you still think it would be helpful, I would happy to send you my ALU program.  I know it's very unlikely that the Not16 implementation would be failing, but am not sure what else might be going on.

Thanks again!

Becca
Reply | Threaded
Open this post in threaded view
|

Re: Not16 failure in building the ALU

cadet1620
Administrator
Another thing to try is to put your ALU and no other HDLs in a subdirectory and test it.  This makes sure that some other defective HDL is not freaking out the simulator.

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

Re: Not16 failure in building the ALU

Becca
Hi Mark,

I discovered that when I change the output variable (i.e. Not16(in=x, out=out);), 'out' displays as the correct value.  Any idea why 'out' would display correctly, but an internal variable (notx) wouldn't?  It seems very strange!

Thanks,

Becca
hcc
Reply | Threaded
Open this post in threaded view
|

Re: Not16 failure in building the ALU

hcc
I get the same problem. Even after I implemented my own not16 and verified my not16 worked fine,
my ALU16 still have the same issue.

Please let me know if you solved the problem, or you made any other progress/discovery.
hcc
Reply | Threaded
Open this post in threaded view
|

Re: Not16 failure in building the ALU

hcc
I observe something odd:

If I include in ALU.hdl file only:
        Not16(in=y,out=out);
out shows the right value

If I include in ALU.hdl file only:
        Not16(in=y,out=noty);
Noty is always -1;

If I have both:
        Not16(in=y,out=out);
             Not16(in=y,out=noty);
then both out and outy are right.

Reply | Threaded
Open this post in threaded view
|

Re: Not16 failure in building the ALU

cadet1620
Administrator
This is really bizarre. Working with my ALU.hdl in an otherwise empty subdirectory (no need for the test script):

  o  The "eval" button is properly enabled using the complete HDL file.
  o  Commenting out the connections to all three outputs -- out, zr and ng -- causes the eval button to be permanently disabled.
  o  Commenting out one or two of the output connections does not cause the failure.
  o  Commenting out the connections to out and ng and leaving an internal wire disconnected from its intended input causes the failure.
  o  Commenting out other combinations of two outputs and leaving an internal wire disconnected from its intended input does not cause the failure.

If this is happening to you, I'd suggest checking that all chip outputs are connected to a part output and that all your internal pins/wires are connected on both ends.

--Mark