FPGAs have become famous in recent years because they have a multitude of different applications and are the ultimate programmable logic. But these have a counterpart in CPLDs, which are much better for certain tasks and at the same time much cheaper. What are CPLDs and how are they different from FPGAs?
To understand what CPLDs are, one must first understand the evolution of hardware and, more specifically, its integration over time. Integration should be understood as the progressive union of several devices into one, taking advantage of the growth in the number of devices or transistors per zone.
Integration of circuits over time
Early computers were huge, they actually took up more than one room in many cases. The reason? The architectures were built with a multitude of chips called TTL or 7400 chips in honor of the Texas Instruments series which was the most widely used. What did they consist of? Well, in the basics for building circuits, which could range from simple logic gates to sequential systems such as a binary counter. The designs were made by connecting several of these elements to achieve a specific architecture.
But the advancement of what we call Moore’s Law has brought higher transistor densities and the ability to integrate all the circuits of multiple TTL chips onto a single chip. In the late 1960s, people started talking about large-scale integration, LSI, which involved being able to integrate designs of 1,000 to 10,000 transistors on a single chip. This level of scale allowed what was previously a processor made up of several different chips to be unified into one. From there came the first processors for home computers such as the Intel 8080 and its Zilog clone the Z80, MOS 6502 and Motorola 6800.
But like “mini” computers, as large as a refrigerator or even a closet, new processors required the use of additional circuitry to speed up certain tasks. Early models began to use TTL chips for some functions, but over time the integration of all circuits on a single chip was also adopted, as had happened with processors. This led to the creation of programmable logic, with which companies accelerated the construction of the circuits that accompanied the processor.
At first there was no programmable logic, but ROMS
Technically, a ROM is only used to store data that cannot be read, but fixed-function chips can be created using ROMS. A fixed function chip is a chip that always performs the same task on input data that can vary.
How do you implement a fixed function in a ROM? Simple, as in RAM memory, it has a decoder that selects the output data. It doesn’t really calculate anything, but for example by knowing what is the result of certain arithmetic operations or certain functions, these can be output encoded in a ROM and speed up certain calculations.
The problem? In a ROM, we cannot code the operation of combinatorial logic and neither of sequential logic, so it soon became necessary to create a more complex type of logic for circuit integration and with it cost reduction.
PLA and PAL, the predecessors of CPLD
The evolution towards the use of ROMS for the integration of fixed functions has been the creation of programmable logic tables or PLA, it is a device composed of a series of AND logic gates which are linked to a series of OR gates. and each having one of them a complementary to NOT invert the result. With this, you can create combinatorial logic functions that start with the use of an AND or NAND gate and end with an OR gate. PLA circuits have N inputs which correspond to N AND logic gates and M outputs which correspond to OR logic gates.
Another type of programmable logic was called PAL, Programmable Array Logic, where despite the similarity of the name, they did not work the same since OR gates were fixed and not programmable and therefore were less versatile, but much cheaper.
The impact of using PAL and PLA? This was quite important, as it allowed the implementation of combinatorial and sequential circuits on a single chip. For example, video systems based on a multitude of TTL chips have been integrated into a single processor. Two clear examples of the use of PAL and PLA chips can be found on the one hand in the Sinclair ZX81 versus the ZX80 and in the Apple Macintosh video system, where they managed to integrate all video circuits into a single chip, reducing costs compared to the Apple Lisa created by Apple itself.
But PALs and PLAs quickly became obsolete, and new types of programmable logic appeared over time. Today, the ones that stand out the most are FPGAs, but they are not the most used, but CPLDs.
What is a CPLD and how does it compare to an FPGA?
A CPLD, whose acronym stands for Complex Programmable Logic Device, like an FPGA is a type of programmable logic, but whose operation derives from ROM, PLA and PAL. Its architecture and operation are therefore totally different from FPGAs.
Thanks to the differences with an FPGA, you will understand what CPLDs are and where and how they are used.
- FPGAs are better prepared to simulate hardware that is dependent on time, clock cycles, while a CPLD is more designed for what with combinatorial circuits and therefore does not depend on a sequence of steps per cycle.
- In a CPLD the time required for a function synthesized in it will always be the same, in an FPGA it will not. Therefore, CPLDs are used to design combinatorial circuits.
- FPGAs are considered to be very high-end products and therefore at a high cost. The CPLD on the contrary.
- FPGAs can operate at much higher clock speeds than a CPLD.
- An FPGA must be reprogrammed every time it is turned on, because it is deprogrammed when it is turned off, a CPLD works like a ROM, and it will not lose its configuration when the device is turned off. This means that FPGAs are based on RAM in their architecture and CPLDs on ROM.
So we will never see something complex like a CPU implemented in a CPLD because they are not designed for that. Today, CPLDs are often integrated into FPGA development boards, so it is common to combine the two types of programmable circuits.
How does a CPLD work?
A CPLD is basically nothing more than an improved and therefore more complex version of a PLD device. What are PLD devices? We have said them before and they are what we called PLA in their day.
A CPLD is nothing more than a series of PLA as an input function, but its OR gates do not generate an output, but its output is distributed through a matrix that connects to another series of PLA functions. , which can give an output or a result feed. back in the opposite direction.
In a CPLD, therefore, all the possible logical functions are coded in the different PLAs which are combined to achieve the final function that is to be obtained. In general, in the design of new processors, CPLDs are used for both simulating combinatorial logic and fixed function, while FPGAs are used for sequential logic and more complex elements such as ALUs. Out of curiosity, the instructions of the decoding units of CPUs and GPUs are usually implemented first in CPLD, because basically they are nothing more than combinatorial circuits.