loading

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).

 https://www.instructables.com/answers/Whats-an-FPGA-Whats-an-CPLD/

 https://www.instructables.com/id/Ghetto-Programmable-Logic-CPLD-Development-Syste/


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.
 
 

Programmable logic devices, what are they? Specifically they are an integrated circuit that you program using a hardware description language such as VHDL or Verilog. Other languages that you may have heard of are CUPL or ADA. With the correct tools you can even generate a schematic that is used to build the file that will be used to program the device.
 
 

 There are several types of programmable logic available. Older versions like the programmable array logic (PAL) such as the PAL20R8, the generic array logic (GAL) such as the GAL22v10, the programmable logic device (PLD) such as the 22V10, the simple programmable logic device (SPLD) such as the 20V8 have been around for quite some time.
 
 

The complex programmable logic device (CPLD) such as the XC2C32A from Xilinx, and the field programmable gate array (FPGA) such as the XC3S50 from Xilinx are some of the newer versions of programmable logic that are a result of improvements to the original types of devices.



These types of devices are available from several manufacturers such as Texas Instruments, Cypress Semiconductor, Atmel, Lattice Semi, Altera, Actel, and Xilinx. Some of these suppliers no longer manufacture these devices themselves but have sold the rights to Rochester Electronics who manufactures them with the same part numbers and logos while some like Lattice still offer GAL devices in addition to newer CPLDs and FPGAs.

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.

A selection guide for Xilinx CoolRunner II devices is shown below and the PDF is attached if the image is too fuzzy for you.
 

To get an idea of what other devices are out there here are some links to get you started:

 

www.xilinx.com

www.altera.com

www.atmel.com

www.digikey.com(my favorite source for parts).

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.

All the mainstream suppliers (Xilinx, Altera, Atmel, and Actel) have free tools. Some need a license (Actel and Atmel) that limits you to a time frame for the tools to work while others are not time based and work forever once you have registered (Xilinx and Altera).

As I use Xilinx that is the tool set that we will cover. The FREE Xilinx tool set is called� WebPack and will allow you to design with most of the parts from Xilinx. This is a complete front to back tool that includes verification capability and two simulators (one from Xilinx and one from ModelSim).

Most of the tools look similar to this. This is Xilinxs ISE tool that you get when you down load WebPack. Here you can write your code and manage your project. For those that don't want to write code they can generate a schematic from with in the tool as shown below.

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.


Step 7: Summary

So there you have it. A basic introduction into Programmable Logic Devices. Personally I prefer Xilinx but have used Altera, Actel, and Cypress in the past.

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.

<p>This is an old conversation but if someone is interested, I wrote a training course for beginners here: https://eliademy.com/catalog/basic-of-the-cx-language.html. Best!</p>
<p>Thanks for this instructable. I'm taking a home-study PLC course and this is a great review for my lessons! <a href="http://www.ciebookstore.com/plc-course" rel="nofollow">http://www.ciebookstore.com/plc-course</a></p><p>Thank you!</p>
I noticed PLD's are used to increase the number of PCI slots a computer has above 4, the larger DIP20 chip is a ATF16V8B-15PC.
PLDs can be a part of the solution but they are generally not the main component behind the addition of a PCI or PCIe slot.
to add PCIe slots you need a bridge. for extra PCI slots, there are 1-slot to two-slot products out there with DIP or SMD PLD chips with a header for slot selection, so i assumed that is all that is required - plus the program it needs to forward commands.
PCI and PCIe needs a bridge or as I refer to that, a controller/UART. There is a bit more than a device or method to select what port or slot as you stated. <br>I work with devices from PLX specifically their OXPCIe952, 954, and 958 devices. Xilinx also has a hard coded solution in their Spartan 6 line but compared to the PLX solution its expensive so it generally only gets used in really high end systems. <br>Check those out especially the PLX products. They have a lot good resources available.
Components Direct offers a wide selection of programmable logic devices (PLD) from Xilinx, which include FPGA and PROM. These devices come in a variety of package types, such as BGA-256, BGA-225, PLCC-84, PQFP-240, PQFP-160 and TSOP-48. Their choice of operating temperature range cover from -40&deg;C to 85&deg;C. These quality programmable logic devices (PLD) are suitable for general-purpose use as well as specific applications.<br><br> http://www.componentsdirect.com<br>http://www.componentsdirect.com/programmable-logic-devices.html
you sir, are a scholar and a gentleman.
ratgod thanks for the comment! Below are a couple of links to a Cyclone II dev kit but they are bit on the expensive side. I would suggest if you havent done so already, then download the web version of Quartus II from Altera. You can get it here: http://www.altera.com/products/software/quartus-ii/web-edition/qts-we-index.html Here is a link to get a Cyclone II dev kit. Its a bit pricey at $199 but it does come with a lot of capability. http://www.buyaltera.com/scripts/partsearch.dll?Detail&amp;name=544-1736-ND The one below is from Newark and is more expensive then the one from Altera directly. http://www.newark.com/altera/dk-cycii-2c20n/cyclone-ii-fpga-starter-development/dp/51R0453?whydiditmatch=rel_1&amp;matchedProduct=DK-CYCII-2C20N&amp;Ntt=DK-CYCII-2C20N I am working on a few low cost dev kits for CPLD and FPGA devices and do have plans for some Altera kits but havent gotten to them yet. If there is enough interest for them I will move them up to the front of the list. Just send me a PM. As for the NIOS processor I would hold off on that until you are familiar with the Altera products that support that soft core before jumping into that.
Favored, Thanks, I really needed a primer on this, Info is hard to get unless you know where to go.
Nice instructable, You said you have used Altera, do you have any information (or links to some information) that would help me get started with an Cyclone II development kit? I've been trying to find tutorials and I'm not getting very far, the best I've done is build a 4-bit adder. I would love to set up a NIOS processor but I think that is getting a little far for the time being.
I used to do a lot of design with 22V10 and 20R8 devices back in the 80's, using PALASM as the development tool. The Xilinx devices with JTAG were just appearing, but before that I&nbsp;was putting extra shifters into circuit blocks to improve node visibility as I&nbsp;was also writing the functional test programs for these boards.<br /> Fun times.<br />
Very nice introduction!&nbsp; Rated and featured.&nbsp; I am curious that you chose not to include microcontrollers as programmable devices in this analysis.&nbsp; They seem to be the most common for DIY&nbsp;developers, probably because they provide I/O for process monitoring and control as part of the device.<br /> <br /> Several years ago, my former high-energy physics experiment (BaBar)&nbsp;completed an upgrade of some of our front-end electronics to use Spartan 3 FPGAs.&nbsp; We were able to move all the data processing (waveform feature extraction) that had been programmed in C++&nbsp;on a rack of Motorola PPC boards, down to FPGAs mounted directly on the detector.&nbsp; We reduced the data volume by a factor of 5 (32 bytes per channel down to 6), and the maximum trigger rate from ~2.2 kHz to well over 10 kHz (with zero deadtime).<br />
kelseymh thanks for the comment.<br /> <br /> I didnt include the micro controllers in this instructable for a couple of reasons; The website already has quite a bit of material on them and I wanted to focus on the digital logic side of things and not so much on the embedded side where you would see micro controllers used.<br /> <br /> I do plan on doing a future instructable that talks about using a micro controller core (i.e. IP)&nbsp; such as the PicoBlaze or MicroBlaze micro controller cores from Xilinx.<br /> <br /> Thanks again!<br />

About This Instructable

89,036views

160favorites

License:

Bio: Open source hardware design engineer - in addition to designing power supplies and writing VHDL code for FPGAs and CPLDs, I am also an active part ... More »
More by powerguy:A Beginners Guide to Programmable Logic Devices 
Add instructable to: