Not gate testing faliure

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

Not gate testing faliure

OrionMaster
Hello,

I am having trouble testing the Not gate for Chapter 1. This is my code;

Nand(a=in, out=nota)

When I check the Part Pins it says that out's value is equal to 1 but when testing it, the output is zero. Can some one please help me understand why that is happening?
Reply | Threaded
Open this post in threaded view
|

Re: Not gate testing faliure

cadet1620
Administrator
OrionMaster wrote
Hello,

I am having trouble testing the Not gate for Chapter 1. This is my code;

Nand(a=in, out=nota)

When I check the Part Pins it says that out's value is equal to 1 but when testing it, the output is zero. Can some one please help me understand why that is happening?
You need to connect something to the b input of the Nand.  The hardware simulator defaults the value of disconnected inputs to false, so the output of the Nand is always true.

You need to connect something to the out pin of the Not chip.  Because there is nothing connected to out it value is always false.

Your code says that the output of the Nand gate is connected to an internal wire named nota that doesn't connect to anything else.

--Mark

[Please delete your duplicated post.]
Reply | Threaded
Open this post in threaded view
|

Re: Not gate testing faliure

OrionMaster
Thank you some much, I finally get it. This will help me with the other gates.

[Sorry about the duplicate posts I didn't even notice.]