Problems implementing Not from Nand

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

Problems implementing Not from Nand

fowlertm
I'm having trouble writing a script that implements the Not gate from the Nand gate.  I understand it conceptually and I can even draw the circuit on paper, but somehow I can't get working code.  So far I've read the first chapter of the book, the hardware survival kit, and even the lecture slides, comparing my code to working code whenever I get the chance.  

I've tried several different codes, the latest of which is this:

CHIP MyNot {
  IN a;
  OUT out;
  PARTS:
  Nand (a = a, out = out);
}  

Again, this isn't the only thing I've tried.  When I load this script into the Hardware simulator, it returns a value of "1" for inputs "1" and "0".  

Thanks.  
Reply | Threaded
Open this post in threaded view
|

Re: Problems implementing Not from Nand

cadet1620
Administrator
Nand has two input pins, a and b. Since b is not connected, it has a permanent value of false. You need to do something with b.

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

Re: Problems implementing Not from Nand

fowlertm
That did the trick !  The problem of having a dangling input was one I anticipated but didn't know how to solve, and the graphic representations of circuits did little to help.  I appreciate it!  

-Trent