[Hardware Emulator] Nand problem (Solved)

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

[Hardware Emulator] Nand problem (Solved)

charlie
This post was updated on .
Hi, I'm having a rather confusing problem with the Nand primitive. I don't think this is a bug, it must be a mistake that I'm doing or something weird, maybe the answer is really silly.

My problem is that I can't get the correct output from the Nand primitive, the result is always 1.

for example in the following implementation:

#Implementation edited.

If I debug the value of "nand" (the output of Nand), the result is always 1.
However I can use:
BUILTIN Nand;
and I get the correct result, Am I missing something here?

On a side note, thank you very much for doing this project and making it available for everyone, it's really a great hobby. Too bad for me that I got stuck right at the begining, the texts are so clear and the tools intuitive that I didn't thought I would have a problem until later chapters.

Thanks.

Edit:

I know that this might not be an issue (since the hdl is found, otherwise an error would be issued) but the chapter 01 reads:

"Tips The Nand gate is considered primitive and thus there is no need to build it:
Whenever you use Nand in one of your HDL programs, the simulator will automatically
invoke its built-in tools/builtIn/Nand.hdl implementation."

Actually the path is tools/builtInChips/Nand.hdl
Charlie
Reply | Threaded
Open this post in threaded view
|

Re: [Hardware Emulator] Nand problem

cadet1620
Administrator
Your posted implementation works for me.

I don't understand what you are trying to do with BUILTIN. You should not need it for any of the HDL that you write.

Are you trying to write your own Nand.hdl? You can't do so because Nand is the fundamental primitive.
Also, make sure that you have written and tested Not.hdl since your And.hdl uses it.

Once you've resolved this problem, please edit your original post to remove the working implementation.

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

Re: [Hardware Emulator] Nand problem

charlie
"I don't understand what you are trying to do with BUILTIN"

I just did that to check that I could have an answer at least from the Java class, it was some kind of a safety check. I'm just trying to build the "And" chip.

The implementation is still not working for me and the problem is in the "Nand" output step, when the script reaches the "Not" it correctly inverses the input given.

thank you for your reply.
Charlie
Reply | Threaded
Open this post in threaded view
|

Re: [Hardware Emulator] Nand problem

charlie
Thanks for your reply, the problem was that I haven't implemented the "Not" chip. I thought that it was also a primitive or that I could just use the built-in just for this case, but apparently it wasn't working.

I'll edit the implementation.
Charlie
Reply | Threaded
Open this post in threaded view
|

Re: [Hardware Emulator] Nand problem

cadet1620
Administrator
It's important to implement the chips in the order listed in 1.3 to avoid trying to use unimplemented parts. If you haven't read the Hardware Construction Survival Kit, you might want to do so.

--Mark