Project 01

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

Project 01

crisam
Hello, I am interested in getting started with the project material with creating the 15 gates.
I have gone through the Appendix A.6 and A.7 as well as the "Hardware Simulator Tutorial"
I am ready to edit my files and load them into the simulator but I am not sure how to write the code for the chipset Not.

I can add the BUILTIN Not; This allows the code to run properly and the test to pass.


I would like to have a few simple examples on writing code in HDL. I normally write code for
higher level programming classes so my mind keeps trying to write it in that context.

thanks
Reply | Threaded
Open this post in threaded view
|

Re: Project 01

WBahn
Administrator
They give you an example in Fig 1.6, where they show you one way to implement an Xor gate.

You just want to do the same thing for your Not gate, with the limitation that all you can use are Nand gates.

I would recommend doing what they are doing in that Figure. First, draw out the schematic of how you would use interconnect the parts you are using and how they would connect to the pins of the part you are making. Then label each wire with a name. Wires connected to pins have to use the pin name, but wires that are just interconnecting parts internally can use any name you want -- but they have to have a name.

The HDL code itself is nothing but saying which wire each pin on each part is connected to. It's no more complicated than that.
 
Reply | Threaded
Open this post in threaded view
|

Re: Project 01

crisam
Thanks for that information. Are you saying that I do not have to name my gates nand?
Reply | Threaded
Open this post in threaded view
|

Re: Project 01

WBahn
Administrator
For the Nand gate you have no choice but to call it Nand because you aren't building a Nand gate -- it is supplied to you. But if you really wanted to design a gate named Fred that behaves like a Fred gate and, in all future chips, wherever you want to use a Not gate you use your Fred gate instead, that will work. The only place where you will have a problem is the test script for the Not gate because it loads a file called Not.hdl. But you could edit the file to load Fred.hdl to make it work.

Having said that, don't do that. Use the names the authors provide -- it will make your life SO much easier.