CPLD Tutorial: Learn Programmable Logic The Easy Way

The guys over at hackshed have been busy. [Carl] is making programmable logic design easy with an 8 part CPLD tutorial. (March 2018: Link dead.  Try the Wayback Machine.) Programmable logic devices are one of the most versatile hardware building blocks available to hackers. They also can have a steep learning curve. Cheap Field Programmable Gate Arrays (FPGA) are plentiful, but can have intricate power requirements. Most modern programmable logic designs are created in a Hardware Description Language (HDL) such as VHDL or Verilog. Now you’ve got a new type of device, a new language, an entirely new programming paradigm, and a complex IDE to learn all at once. It’s no wonder FPGAs have sent more than one beginner running for the hills.

The tutorial cuts the learning curve down in several ways. [Carl] is using Complex Programmable Logic Devices (CPLD). At the 40,000 foot level, CPLDs and FPGAs do the same thing – they act as re-configurable logic. FPGAs generally do not store their configuration – it has to be loaded from an external FLASH, EEPROM, or connected processor. CPLDs do store their configuration, so they’re ready as soon as they power up. As a general rule, FPGAs contain more configurable logic than CPLDs. This allows for larger designs to be instantiated with FPGAs. Don’t knock CPLDs though. CPLDs have plenty of room for big designs, like generating VGA signals.

[Carl] also is designing with schematic capture in his tutorial. With the schematic capture method, digital logic schematics are drawn just as they would be in Eagle or KiCad. This is generally considered an “old school” method of design capture. A few lines of VHDL or Verilog code can replace some rather complex schematics. [Carl’s] simple designs don’t need that sort of power though. Going the schematic capture route eliminates the need to learn VHDL or Verilog.

[Carl’s] tutorial starts with installing Altera’s Quartus II software. He then takes the student through the “hardware hello world” – blinking an LED.  By the time the tutorial is done, the user will learn how to create a 4 bit adder and a 4 bit subtractor. With all that under your belt, you’re ready to jump into big designs – like building a retrocomputer.

[Image via Wikimedia Commons]

16 thoughts on “CPLD Tutorial: Learn Programmable Logic The Easy Way

    1. Unfortunately you comment is still showing, grow up and stop being so immature, I hope they do delete it. It adds nothing to this article, it’s about CPLD’s. Not OLEDS, Touchscreens, toilets, or your junk.

      Shame on you.

  1. Interesting, this is almost the exact same IDE and chip-set that is use at my school. They even use the same kind of coursework. Although, blinking the light wasn’t part of it. Everything else is spot on. I might just go though this as a refresher.

  2. For those who want more detail –
    The designs are based on the Altera Max II family, chip is: EPM240T100C5
    They got “A cheap LC Tech board from Ali Express” – don’t ask for more detail, if you can’t find something you’re hosed before you begin.
    And – no, you can’t download the whole series as a single PDF file. For functionality like that, look at the quality Adafruit tutorials.

    1. Thanks for the constructive criticism Alan.
      We haven’t released the guide as PDF at the minute as it’s a work in progress.
      If we receive enough requests for a downloadable version, we may look into it.
      As for the board, we’re currently working on another article which discusses using an official Altera board which comes with support. The “Cheap LC tech” board really is that, cheap, no support, no info. We did the best we could with what we had available.
      I’ll bear your comments in mind for our next part of the guide.

      Other than that, I hope these guides were of some use to someone.

      1. Since starting the guide, we’ve received one of these boards

        It’s a very nice system and we’ve written a short article on the site.
        We’ll write a future article regarding choosing the “right” board and give plenty of links.

        For now, we’re going to continue with the official Altera board.
        These CPLD guides are really less about the board and more about the chip itself… or rather, the process of getting the chip to do something.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.