CPLD, Characteristics and Specifications of This Programmable Logic

CPLD, Characteristics and Specifications

FPGAs have become famous in recent years as they have a multitude of different applications and are the programmable logic par excellence. 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, we must first understand the evolution that hardware has had and, specifically, its integration over time. We must understand integration as the progressive union of several devices into one, taking advantage of the growth in the number of devices or transistors per area.

Circuitry integration over time

Chips TTL

The first computers were huge, they actually took up more than one room in many cases. The reason for it? The architectures were built with multitudes of chips called TTL or 7400 chips in honor of the Texas Instruments series that was the most widely used. What did they consist of? Well, in basic elements for the construction of 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 obtain a specific architecture.

But the advancement of what we call Moore’s Law brought with it higher transistor densities and the ability to integrate entire circuitry of multiple TTL chips on a single chip. In the late 1960s, people began to talk about large-scale integration, LSI, which consisted of being able to integrate designs of 1000 to 10,000 transistors on a single chip. This level of scale allowed what was previously a CPU composed of several different chips to be unified into one. From there came the first CPUs for home computers such as the Intel 8080 and its Zilog clone the Z80, the MOS 6502 and the Motorola 6800.

But like “mini” computers, as large as a refrigerator or even a closet, the newer CPUs required the use of additional circuitry to speed up certain tasks. The first models began to use TTL chips for certain functions, but over time the integration of entire circuitry on a single chip was also adopted as had happened with CPUs. This led to the creation of programmable logic, with which companies accelerated the construction of the circuitry that accompanied the processor.

At first there was no programmable logic, but ROMS

Technically a ROM only serves to store data that can only be read, but fixed function chips can be created using ROMS. A fixed function chip is one 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 the RAM memory this has a decoder that selects an output data. It is not really calculating anything, but for example from knowing what the result of certain arithmetic operations or certain functions is, these can be encoded as outputs in a ROM and speed up certain calculations.

The problem? In a ROM we cannot encode the operation of the combinational logic and neither the sequential one, so it soon became necessary to create a more complex type of logic for integration of the circuitry and with it the reduction of costs.

PLA and PAL, the predecessors of CPLD

PLA antecesor CPLD

The evolution to the use of ROMS for the integration of fixed function was the creation of the Programmable Logic Arrays or PLA, It is a device composed of a series of AND logic gates that are linked to a series of OR gates and each having one of them a complementary NOT to invert the result. With this you can create combinational logic functions that start with the use of an AND or NAND gate and end with an OR gate. PLA circuits have N inputs that correspond to N AND logic gates and M outputs that correspond to OR logic gates.

PLA antecesor CPLD

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 the OR gates were fixed and not programmable and therefore were less versatile, but much cheaper.

ZX80 vs ZX81

The impact of both PAL and PLA use? It was quite important, as it allowed the implementation of combinational and sequential circuits on a single chip. For example, video systems that were based on a multitude of TTL chips became integrated into a single processor. Two clear examples of the use of PAL and PLA chips are found on the one hand in the Sinclair ZX81 compared to the ZX80 and in the video system of the Apple Macintosh, where they managed to integrate all the video circuitry on a single chip, reducing costs compared to to the Apple Lisa created by Apple itself.

But PALs and PLAs soon became out of date, 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?

CPLD FPGA comparados

A CPLD, whose acronym stands for Complex Programmable Logic Device, like an FPGA is a type of programmable logic, but whose operation derives from ROMS, PLA and PAL. So its architecture and operation is totally different from FPGAs.

Through 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 depends on time, clock cycles, while a CPLD is more designed for what with combinational circuits and therefore do not depend on a sequence of steps per cycle.
  • In a CPLD, the time it takes for a synthesized function in it will always be the same, in an FPGA it will not. Hence, CPLDs are used to design combinational circuitry.
  • FPGAs are thought of as very high-end products and therefore with a high cost. The CPLD on the contrary.
  • FPGAs can run at much higher clock speeds than a CPLD.
  • An FPGA needs to be reprogrammed every time it is turned on, since 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, since they are not designed for it. Today CPLDs are often integrated into FPGA development boards, so it is common to combine both types of programmable circuitry.

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 were known as 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 with another series of PLA functions, which can give a result output or feed back in the opposite direction.

In a CPLD, therefore, all the possible logical functions are encoded in the different PLAs that are combined to achieve the final function that one wants to obtain. In general, in the design of new processors, CPLDs are used both to simulate combinational logic and the fixed function, while FPGAs are used for sequential logic and more complex elements such as ALUs. As a curiosity, the decoding units instructions of CPUs and GPUs are usually implemented first in CPLD, since at heart they are nothing more than combinational circuits.