Introduction: A Beginners Guide to Programmable Logic Devices
I put this instructable together after noticing that there really isn’t anything on the website about programmable logic except for one question and one instructable about a programmer (see links below).
So in an effort to try to help everyone understand what a programmable logic device is and as a
means of posting my first instructable here you are.
Step 1: Types of Programmable Logic Devices.
For those that noticed, I mentioned two types of parts, a PLD (and variants) and FPGA. What are the differences? The short answer is architecture. The FPGAs generally have lots of Flip Flops while PLDs have much fewer if any at all.
In addition today’s FPGAs usually get other features such as built in multipliers, dedicated block ram, and can generally handle more interface standards (such as LVDS). Most FPGA devices need a separate device to program them (the exception to this is Actel and the Spartan 3AN series from Xilinx). This is due to the fact that most FPGAs are SRAM based devices and when power goes out, the program is lost. The FPGA architecture is structured similar to the pictures below:Step 2: Types of Programmable Logic Devices Part II
CPLDs on the other hand dont need a separate device to program them and they do not loose their program when power is cycled or lost. Their architecture is completely different from that of a FPGA as shown below. In addition some CPLDs are able to handle different signaling schemes (LVDS, HSTL, etc) as well as have the ability to consume tiny amounts of power when put into power miser modes.
As you can see the Xilinx device is broken out in to I/O Blocks, programmable logic arrays (PLA), and the advanced interconnect matrix (AIM). Programming is done via the JTAG pins on the device.
The PLA is part of the function block. As you can see signals are routed from the I/O Blocks to the function block then to the AIM and vice-versa. From the picture you can see small blocks labeled MC1 to MC16. These are macro cells.
The PAL, GAL, and PLD devices have an architecture as shown below.
Step 3: What Device Do I Use?
Like micro controllers you have lots of options and price points. The main thing to consider when selecting a PLD or FPGA is what is it you need to do. Remember programmable logic devices wont have a any analog inputs such as A/D (The exception to this is the Actel Smart Fusion and that is yet another instructable) so everything is digital in nature. Practically anything you can do in a micro controller can be done in a piece of programmable logic and in a great many designs engineers routinely use both a FPGA/CPLD with a Microprocessor or micro controller.
To get an idea of what other devices are out there here are some links to get you started:
www.digikey.com(my favorite source for parts).
Attachments
Step 4: Tools
Like micro controllers, you need a tool to allow you to develop your code, test it both before and after layout via simulation, and at some point be able to program your part. Depending on your budget you can get tools that range from being free to easily spending $50,000. The free tools really are all that you will need. Anything beyond that is going to be for the hard core or those who work for a company that has paid for a tool set from someone like Mentor Graphics or Synplicity.
�
Step 5: Development Kits
For most of us a development kit is an absolute must. So what is out there? For Xilinx there are kits that start at $40 and can run as high as a few thousand dollars.
What will $40 get you? A CPLD starter kit from Xilinx that includes everything you see below:
For those that want to get into FPGAs then there are the Spartan 3 kits that start at $49 such as the Avnet Spartan 3A Evaluation Board as shown below and it comes with the CD and programming cable as well:
�
Step 6: VHDL, Verilog, or Schematics
Now for one of the easiest and hardest questions to answer; what language do I use if any at all? This question alone has been the source of some heated arguments amongst engineers so I will talk a bit about three options.
Schematic entry. Possibly the least difficult if one has experience with logic design at the gate level. Most tools have all the gates in the component library. The draw back is that with a schematic you have to specify and place each gate unless you have built functions and have saved them. With coding, you can describe how you want the logic to operate and not have to explicitly call out each gate. This is one of the benefits of coding with a hardware description language or HDL.
VHDL and Verilog are programming languages used to describe hardware type logic. Both are high level languages like C and C++ but do allow one to code a logic function at a very basic (i.e. gate level) level.
Here are some examples of an AND Gate using VHDL and Verilog in the attached PDF.
Attachments
Step 7: Summary
I hope this instructable was able to answer most questions that you might have had and hopefully it will cause you to have other questions as well.
Be on the lookout for more instructables dealing with programmable logic devices.