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]
18 thoughts on “CPLD Tutorial: Learn Programmable Logic The Easy Way”
I wish someone made a toilet seat out of OLED screens. If the middle part had a touchscreen too you could play games with your finger or your weiner.
Dude, What the heck ?
You have plenty other things to do with your weiner than playing Candy Crush…
Do you want aids? That’s how you get aids.
Bloody mods removed my awesome comment about playing games with weiner. Shame on you.
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.
Interesting article Adam.. I’m thinking about following Carl. Just waiting on the programmer.
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.
I think there are a great books and much more useful and well documented. Ask me if you are interested about it
A great book about VHDL with Altera CPLDs and FPGAs with a lot of examples is:
“Digital Electronics: A Practical Approach with VHDL”
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.
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.
I think the board is this one:
So the Ali Express website to buy it would be:
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.
For those who want to use FPGAs with modern tools and languages, I wrote a tutorial on Eliademy on how to program FPGA with the Cx language https://eliademy.com/catalog/basic-of-the-cx-language.html. I hope that it will be useful :-)
Looks as though the Hackshed links are broken :-(
Tried the wayback machine link?
Please be kind and respectful to help make the comments section excellent. (Comment Policy)