GateClass name expected error

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

GateClass name expected error

unusuallytallgnome
This is most likely a syntax issue, I've read and reread the chapter and appendix, however I cannot figure out what I'm doing wrong.  May one of you fine people help me debug this.

I've tried to name the Nand:

 BUILTIN Nand OneNand (a = pos, b = in, out = x);

I've also just used:

 BUILTIN Nand (a = pos, b = in, out = x);

I've tried different purmentations of pos, 1, neg, 0 for the input of a as well.
Reply | Threaded
Open this post in threaded view
|

Re: GateClass name expected error

cadet1620
Administrator
unusuallytallgnome wrote
This is most likely a syntax issue, I've read and reread the chapter and appendix, however I cannot figure out what I'm doing wrong.  May one of you fine people help me debug this.

I've tried to name the Nand:

 BUILTIN Nand OneNand (a = pos, b = in, out = x);
I'm not sure I understand what you are asking.

If you are trying to build a Nand chip, don't. The only Nand.hdl file that should exist is the one in
    nand2tetris/tools/builtInChips.

If you are trying to use a Nand gate in your Not.hdl, there is no need to "predefine" it.  It's already available, just use it in the PARTS section of your Not:
    Nand (a=___, b=___, out=___);

You will not use the BUILTIN (or CLOCKED) keyword in your HDL.

Read the Hardware Construction Survival Kit.

I've tried different purmentations of pos, 1, neg, 0 for the input of a as well.
Read A.5.2 Input Pins section: "one of the constants ..."

--Mark