Learning FPGA and Verilog A Beginner's Guide Part 1 - Introduction

Printer-friendly versionSend to friendPDF version


Learning electronics can be a bit challenging sometimes, but it is real fun if you have a little patience to read, understand and experiment. FPGAs need not be any different. Let us give it a try and see how fast and easily we can learn. To get the best out of this tutorial series, I strongly recommend to download the tools listed at the end of this document and try doing every step as you read along.

Some time back, I wanted to learn about programming FPGAs. I started googling only to find that there is no tutorial on the web (at least I couldn't find any, maybe it is time to refine my googling skills!) that can get you started with learning an HDL and take you all the way through design, simulation and implementation. There are many tutorials online that will help you learn HDLs, some tutorials tell you how to do simulation, some may tell you about implementation, but no single tutorial that guides you step by step from basics to implementation.

I write this tutorial in the hope that it may help our readers to learn Verilog (The HDL I chose to learn first because of its syntax similarity to C), simulate your code and implement it on real hardware. This tutorial expects you to have basic knowledge in Digital Electronics, Familiarity with some programming language (preferably C). This tutorial is not meant be an in-depth study about Verilog or FPGAs or anything, but just a guide to walk you through different basic things you need to know to design a simple digital circuit in Verilog, simulate it and implement it on hardware.

We will be using Xilinx ISE for simulation and synthesis. The final design will be programmed to an Elbert - Spartan 3A FPGA Development Board  (below picture) to make sure our code works on real hardware as well. 


What is FPGA ?

FPGA stands for "Field Programmable Gate Array". As you may guess, FPGA essentially is a huge array of gates which can be programmed and reconfigured anytime anywhere. "Huge array of gates" is an oversimplified description of FPGA. FPGA is indeed much more complex than simple array of gates. But the point is, there are many gates inside the FPGA which can be arbitrarily connected together to make a circuit of your choice. FPGAs are manufactured by companies like Xilinx, Altera, Actel etc.. . FPGAs are fundamentally similar to CPLDs but CPLDs are very small in size and capability compared to FPGA. 


What is Verilog?

Verilog is a Hardware Description Language (HDL) which can be used to describe digital circuits in a textual manner. We need to write our program for FPGA using an HDL like Verilog (as if you write microcontroller programs in C and Assembly). Before HDLs were popular, engineers used to design everything with schematics. Schematics are wonderfully easy for small designs, but are painfully unmanageable for a large design (think about Intel engineers drawing schematics for Pentium, which has millions of gates! it is unacceptably complex). If you have some electronics background, your initial tendency will be to use schematics to realize your design instead of learning a new language (This happened to me, honestly). But learning Verilog is easier than drawing 10 pages of schematic, especially if you have some programming background. VHDL is also another popular HDL used in the industry extensively. Verilog and VHDL share more or less same market popularity, but I chose Verilog since it is easy to learn and it's syntactical similarity to C language. Once you are comfortable with Verilog, it should be easy learn VHDL as well. Want to read more about Verilog? Check out this wiki page (http://en.wikipedia.org/wiki/Verilog) or check this tutorial (http://www.asic-world.com/verilog/index.html).


What tools do we need?

1. A good text editor (I use Notepad++ )

2. Xilinx ISE Webpack (Download at Xilinx for free. Registration required).

3. A good FPGA development board (Elbert - Spartan 3A FPGA Development Board is used in the examples here )

4. Elbert Configuration downloader software (Required only if Elbert - Spartan 3A FPGA Development Board is used)


Read Part2 of this tutorial here.



ISE Design Suite is around 8GB. How big is the Webpack?


I don't think Webpack is available as a separate download. You will need to download the full application and select Webpack license after installation.


I downloaded Vivado, they don't support spartan 3, spartan 6 anymore. Only support for the last ones like Zynq

RE: Vivado

Vivado only supports 7-series devices and up. All other devices 6-series and older are supported by ISE. I suggest downloading and installing the latest version which is 14.7.


You will need to download ISE. Vivado does not support Spartan 3/6 devices.


the xilinx app works in ubuntu?

just saw it works :)

just saw it works :)