# How do I learn HDL

I have a course in Digital Design in this semester and just love it. Now I know that most of the work in embedded system and digital design is done on computer simulators first and then implemented using hardwares. So I was wondering how should I go about learning HDL. I have few questions

1. What? I don't know what are the standards but would like to learn which is simple to pick up. I understand that most of the HDLs are designed for use with FPGAs I don't what that.
2. How? Should I follow a text book with independent examples or should I embark upon a project like implementing a small system (may be something like traffic light control).
3. Where? Where would I get the resources?
• Can you clarify what you do want out of your HDL? Most HDLs are designed for use with FPGAs because that's what most people need an FPGA for. In general, a simulator (working from a graphical schematic) is used for non-FPGA and non-ASIC circuit design. Do you want to build: (1)Discrete digital circuits, i.e. 74XX components, (2) Analog circuits, i.e. switching regulators, RF antennas/transceivers, generic op-amp circuits, or (3) Analog mixed-signal circuits, i.e. Interfacing between both digital and analog signals. – Kevin Vermeer Jul 18 '10 at 18:16
• I think I want to learn HDL to describe hardware. That is 1, 2 and 3. Also in one I want it to be non FPGA specific because I don't have the access or the finances to obtain those. – Rick_2047 Jul 19 '10 at 14:13
• I think I want to learn HDL to describe hardware. That is 1, 2 and 3. Also in one I want it to be non FPGA specific because I don't have the access or the finances to obtain those. I think mainly I want to use the HDL to simulate what I think up. A major plan of mine this year is to make my own computer. I think I will be using 74xx for that. Thats why to test my theories and circuits the idea of HDL came up. – Rick_2047 Jul 19 '10 at 14:15

Can you clarify what HDL you want to use? The choices are basically Verilog or VHDL, [EDIT], and their relatives, Verilog-ASM and VHDL-ASM (Analog mixed-signal). [/EDIT]Verilog has some C-like syntax, which makes it easier to pick up if you've worked with C before, but this also makes it easy to develop bad habits - You can't program hardware in C, because it's all parallel! Also like C, it assumes you know what you're doing, and it's easy to shoot yourself in the foot. VHDL forces you to think in a totally different way, which is helpful, but difficult. It is more verbose, and more likely to warn you if you do something strange. See this Slashdot discussion, or this article.

EDIT: The "Netlist languages" are not something I've used for design work (in a text editor), but I suppose that you could. SPICE, Cadsoft Eagle's format, and EDIF are all examples (with very different purposes) that come to mind. I've only used netlists to verify that my schematic is correct (does each connection in my Eagle schematic make sense), to tweak the abstraction provided by a simulator (SPICE, similar to the way one uses ASM statements in C), or to do export/import between different programs (EDIF).
The Spectre netlisting language is related to Verilog-A[nalog] and SPICE, and is designed for design and verification work. MAST is a component modeling language which is compatible with Verilog-AMS and VHDL-AMS. Searching for tutorials on these languages shows that tools which look like schematic capture utilities are often used, rather than programming in the netlisting language itself.

I'll also second the Xilinx Spartan FPGA, and a Digilent dev board. However, I'd go with the Basys ($60) or Nexys ($100) if you don't need the Ethernet on the Starter board (\$150) mentioned by O Engenheiro (Prices with education discount). The Basys and Nexys are cheaper and therefore more popular in schools, so there are more tutorials and labs online.

• I was wondering if learning the so called "Netlist" languages would be beneficial or easier over learning Verilog or VHDL? – Rick_2047 Jul 16 '10 at 16:24
• Hard to say. It depends on what you want to do with your language. Can we get a better idea of what you want to do and what kind of language you want to use before we delve into the how and where for every permutation of a half-dozen languages and a great many use cases? – Kevin Vermeer Jul 18 '10 at 20:06

I'm almost in the same situation as you.

What I'm doing:

I'd took a free very basic course of VHDL in the college that I'd studied. I'd played with Spartan 3E board.

So, I bought the board and I will start to play.

A friends of mine have suggested these books:

1. Rapid Prototyping of Digital Systems , James O. Hamblen, Michael D. Furman
2. Doone Publications - HDL Chip Design , Douglas J Smith

And he have suggested this doc too:

Xilinx Synthesis and Simulation Design Guide

• I'd second the Hamblen and Furman book. I designed my own little Altera Flex 10K10 board and was able to use most of the code in the book with it. It's a cookbook, but none the worse for that. – Leon Heller Jul 14 '10 at 22:08
1. There are two HDL languages, they're VHDL and Verilog, ask to your professor wich language will you learn and try to see how it works: the syntax and how could you make modules on this and make a big review about ALL digital circuits.

2. Before making any things do 1, make sure that you really know everything about digital circuits, because that HDL don't create anything new, you only use these things on a different way. So you can use one of the two books above, to do some exercises, ask you teacher the books that he recommends and use them or one of the two above.

3. Ask to you teacher wich FPGA do they use on the classes, if it's Altera, Xilinx, Lattice or other, if Altera make the download of the Quartus Web Edition, if Xilinx, the ISE Webpack, make the free download of one of these and try to learn about one of the softwares and do some of your exercises, simulations on one of them.

You are right, about 90% of the work on HDL are on simulators, so learn about the Modelsim simulator, and/or the ISIM simulator on xilinx, they commands and how to do testbenches.

• Two major HDLs. There are many less popular ones, such as CUPL, MyHDL and Lava. The Digital Design course at my university mentioned VHDL but used CUPL in a lab. More on wikipedia: en.wikipedia.org/wiki/… – Yann Vernier Oct 7 '10 at 19:45

wherever you end up working you will have to use the same HDL they already use - so to increase the chances of getting hired try and spend a bit of time with both Verilog and VHDL. It used to be pretty simple: Verilog was used in the US and VHDL in Europe - these days it's not a simple.

Upthread someone mentioned learning to 'think differently' for VHDL - you have to do that for verilog too it looks like C but it's not - a good place to start is to look and see where wires and flops are created during synthesis - once you reach the point where you can see those, and can just 'see' timing hazards in your head you're most of the way there

icarus verilog or verilator are what I would recommend for learning or playing with verilog. ghdl is what I would use to play with vhdl. Far from mainstream but I would also recommend cyclicity-cdl.sf.net which has its own sim environment, etc and produces synthesizable verilog. use and learn gtkwave for examining the .vcd files generated by the simulators.

I learned Verilog in college in one course. The culmination of that course was the implementation of a 2-way Superscalar MIPS processor (30% of the class got it completely working; I was in the other 70%). I think things in industry are by-and-large moving away from Verilog and towards VHDL. That being said, there are plenty of online tutorials for both languages. Here's one on VHDL and here's one on Verilog.

You're going to probably want to use ModelSim and you can probably use the student edition (I think it's free; maybe with restrictions). Incidentally they recommend using Digital Systems Design Using VHDL 2nd Edition as a Textbook.

Here's a cheap FPGA development kit that may be right for you. However, I am not sure about the level of Open source tools that work with it. The vendor's toolkit chains are available for free download. I have heard that at the price point this kit is available for, it is worth going and getting it.