# Chap 1 - AND gate

9 messages
Open this post in threaded view
|

## Chap 1 - AND gate

 Can someone supply me with the proper code for the first project?  I just can't get the syntax right, and have only limited time to work on this.  I'm hoping that this will get me jumpstarted as I usually learn pretty good from examples. Thanks, Mike D
Open this post in threaded view
|

## Re: Chap 1 - AND gate

 It's really important to work things out on your own. Have you implemented any basic gates?
Open this post in threaded view
|

## Re: Chap 1 - AND gate

 no - I need an example to work with
Open this post in threaded view
|

## Re: Chap 1 - AND gate

 In reply to this post by curio I am sorry, but as the teacher said, you must do it by yourself. I have pulled out a lot of hair before doing 90% of the work for the first project. But I have the confidence it will be worth it at the end. The mistake of many books is that they are providing the full code, not allowing the student to evolve by itself. As for your problem, think simple... You already have an Nand gate. Nand means "NOT And". So, think logically. How do you get AND from NOT AND? DO that. After that, do Not, Or, Xor and from there you will make all of them. It's magic. 1 and 0 have unlimited powers.
Open this post in threaded view
|

## Re: Chap 1 - AND gate

 I agree, mostly, that the student needs to work through the exercises to grow and understand.  However, there are some gotchas in HDL that can be very easy to miss or not understand after reading the appendix once, or twice, or thrice.  I wish there were one or two annotated examples that don't solve any of the design problems in the projects but that do include examples of the tricky bits of HDL. Even something silly like the following could go a long way in getting people over the hump with their first HDL specification. CHIP Reverse {    IN in[16];    OUT out[16];    PARTS:    And16(a=in, b=in,          out[0]=out[15],          out[1]=out[14],          out[2]=out[13],          out[3]=out[12],          out[4]=out[11],          out[5]=out[10],          out[6]=out[9],          out[7]=out[8],          out[8]=out[7],          out[9]=out[6],          out[10]=out[5],          out[11]=out[4],          out[12]=out[3],          out[13]=out[2],          out[14]=out[1],          out[15]=out[0]         ); }
Open this post in threaded view
|

## Re: Chap 1 - AND gate

 In reply to this post by curio I am in agreement with the poster. Just one example
Open this post in threaded view
|

## Re: Chap 1 - AND gate

 Administrator Synthart wrote I am in agreement with the poster. Just one example Are you asking for something? --Mark