Alright one more problem

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

Alright one more problem

thespacious
So, I have built the not, and, and or gates, and all of them pass the test, but when i go back and check my eval for any of the gates i find that when i plug in a=1, b=1 in any of the nand gates it still outputs a 1. So, going backwards as i was writing this post I realized by Not gate is not implementing correctly, it provides an inverse if the input is 0, but not if the input is 1(a=1: Not(in=a, out=nota); I still get 1 for nota). Is there something obvious i'm just missing, I've checked my code and I'm pretty sure it's right. here it is just in case but. . . .

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

Even I would have a hard time messing that up.
Reply | Threaded
Open this post in threaded view
|

Re: Alright one more problem

thespacious
And here is my xor code, just in case:

    Not(in=a, out=notx);
    Not(in=b, out=noty);
   
   
    And(a=a, b=noty, out=out2);
    And(a=notx, b=b, out=out1);
   

    Or(a=out2, b=out1, out=o3);
Reply | Threaded
Open this post in threaded view
|

Re: Alright one more problem

thespacious
Wow, okay just figured pu the root of my implementation problem, when I give my Nand gate in my And gate .hdl a=1, b=1 it still gives me an output of 1. I really do not understand why.
Reply | Threaded
Open this post in threaded view
|

Re: Alright one more problem

cadet1620
Administrator
Are you talking about failures in the test scripts, or odd behavior in the Hardware Simulator when you manually change values and hit eval?  If your parts are passing the tests, don't worry about odd manual behavior.

These problems are usually caused by chip inputs that aren't connected anything, or part outputs that aren't connected to anything.  For instance in your XOR you have "out=o3" which leaves the wire "o3" not connected to anything, and leaves the XOR's "out" not connected to anything.

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

Re: Alright one more problem

thespacious
Well, it's not that I'm changing any values, when i run the test script(on the And gate) it evaluates correctly for a=0,b=0; a=1,b=0; a=0,b=1;, but for a=1,b=1, the Nand gate I used in the file doesn't return the 0 I need, so even though it then goes through a functioning Not gate the And gate itself never returns a value of 1. So anything i use that and gate in will be wrong.
Reply | Threaded
Open this post in threaded view
|

Re: Alright one more problem

thespacious
Got it, totally works now. Awesome