Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Digital design with CPLD applications and VHDL (R. Dueck, 2000)

.pdf
Скачиваний:
259
Добавлен:
12.08.2013
Размер:
9 Mб
Скачать

330 C H A P T E R 8 • Introduction to Programmable Logic Architectures

Before we examine the structure of an Altera MAX7000S CPLD, we will look at the internal structure of several simpler devices that are based on similar technologies, such as the PAL16L8 and PAL16R8 low-density PLDs (largely for an historical overview), the PALCE16V8, and the GAL22V10.

These devices are based on programmable matrices of sum-of-products (SOP) circuits, as is the Altera MAX series of devices. The main programming element is the EEPROM (electrically erasable programmable read-only memory) cell. EEPROM-based devices will retain their programmed data when power is removed from the device.

The Altera FLEX series of CPLDs is based on another technology altogether. It stores logic functions in look-up tables (LUTs) that act as truth tables with four input bits. The main logic element of the FLEX series is the SRAM (static random access memory) cell. SRAM-based CPLDs must have their programming data loaded every time they are powered up. They have the advantage of being faster than EEPROM devices, with a higher bit capacity.

8.1 Programmable Sum-of-Products Arrays

K E Y T E R M S

Product line A single line on a logic diagram used to represent all inputs to an

AND gate (i.e., one product term) in a PLD sum-of-products array.

Input line A line that applies the true or complement form of an input variable to

the AND matrix of a PLD.

PAL Programmable array logic. Programmable logic with a fixed OR matrix and a programmable AND matrix.

The original programmable logic devices (PLDs) consisted of a number of AND and OR gates organized in sum-of-products (SOP) arrays in which connections were made or broken by a matrix of fuse links. An intact fuse allowed a connection to be made; a blown fuse would break a connection.

Figure 8.1a shows a simple fuse matrix connected to a 4-input AND gate. True and complement forms of two variables, A and B, can be connected to the AND gate in any combination by blowing selected fuses. In Figure 8.1a, fuses for A and B are blown. The output of the AND gate represents the product term AB, the logical product of the intact fuse lines.

Figure 8.1b shows a more compact notation for the AND-gate fuse matrix. Rather than showing each AND input individually, a single line, called the product line, goes into the AND gate, crossing the true and complement input lines. An intact connection to an input line is shown by an “X” on the junction between the input line and the product line.

A symbol convention similar to Figure 8.1b has been developed for programmable logic. Figure 8.2 shows an example.

The circuit shown in Figure 8.2 is a sum-of-products network whose Boolean expression is given by:

F A B C A B C

The product terms are accumulated by the AND gates as in Figure 8.1b. A buffer having true and complement outputs applies each input variable to the AND matrix, thus producing two input lines. Each product line can be joined to any input line by leaving the corresponding fuse intact at the junction between the input and product lines.

If a product line, such as for the third AND gate, has all its fuses intact, we do not show the fuses on that product line. Instead, this condition is indicated by an “X” through the gate. The output of the third AND gate is a logic 0, since (A A B B C C) 0. This is necessary to enable the OR gate output:

A B C A B C 0 A B C A B C

FIGURE 8.1

Crosspoint Fuse Matrix

FIGURE 8.2

PLD Symbology

8.1 • Programmable Sum-of-Products Arrays

331

A

A

B

B

 

 

Intact

 

 

 

 

A B

 

Blown

 

 

a. Crosspoint fuse matrix ( A and B intact )

A

A

B

B

A B

b. PLD notation for fuse matrix

Unconnected inputs are HIGH (e.g., A 1 B 1 1 C A B C for the the first product line).

If the unused AND output was HIGH, the function F would be: A B C + A B C + 1 = 1

The configuration in Figure 8.2, with a programmable AND matrix and a hardwired OR connection, is called PAL (programmable array logic) architecture.1

Since any combinational logic function can be written in SOP form, any Boolean function can be programmed into these PLDs by blowing selected fuses. The programming

1PAL is a registered trademark of Vantis Semiconductor.

332 C H A P T E R 8 • Introduction to Programmable Logic Architectures

is done by special equipment and its associated software. The hardware and software selects each fuse individually and applies a momentary high-current pulse if the fuse is to be blown.

The main problem with fuse-programmable PLDs is that they can be programmed one time only; if there is a mistake in the design and/or programming or if the design is updated, we must program a new PLD. More recent technology has produced several types of erasable PLDs, based not on fuses but on floating-gate metal-oxide- semiconductor transistors. These transistors also form the basis of memory technolo-

gies such as electrically erasable programmable read-only memory (EEPROM or E2PROM).

8.2 PAL Fuse Matrix and Combinational Outputs

K E Y T E R M S

JEDEC Joint Electron Device Engineering Council

JEDEC file An industry-standard form of text file indicating which fuses are blown and which are intact in a programmable logic device.

Text file An ASCII-coded document stored on disk.

Checksum An error-checking code derived from the accumulated sum of the data being checked.

Cell A programmable location in a PLD, specified by the intersection of an input line and a product line.

Product line first cell number The lowest cell number on a particular product line in a PAL AND matrix where all cells are consecutively numbered.

Input line number A number assigned to a true or complement input line in a

PAL AND matrix.

Multiplexer A circuit that selects one of several signals to be directed to a single output.

Figure 8.3 shows the logic diagram of a PAL16L8 PAL circuit. This device can produce up to eight different sum-of-products expressions, one for each group of AND and OR gates. The device has active-LOW tristate outputs, as indicated by the “L” in the part number. Each is controlled by a product line from the related AND matrix.

The pins that can be used only as inputs or outputs are marked “I” or “O,” respectively. Six of the pins can be used as inputs or outputs and are marked “I/O.” The I/O pins can also feed back a derived Boolean expression into the matrix, where it can be employed as part of another function. A detail of an I/O section is shown in Figure 8.4.

The part number of a PAL device gives the designer information about the number of inputs and outputs and their configurations, as follows:

Number of inputs

Output type:

H Active HIGH

L Active LOW

P Programmable polarity

R Registered (D flip-flop)

X XOR registered

C Complementary (both HIGH and LOW)

Number of (registered) outputs

PAL 16 R 8

8.2 • PAL Fuse Matrix and Combinational Outputs

333

FIGURE 8.3

Unprogrammed PAL16L8

The numbering system has some potential ambiguities. For example, it is not possible to use 16 inputs and 8 outputs in a PAL16L8 device at the same time; 6 of the inputs are actually input/output pins. Some possible configurations are as follows:

16 inputs (10 dedicated 6 I/O) and 2 dedicated outputs

10 dedicated inputs and 8 outputs (2 dedicated 6 I/O)

12 inputs (10 dedicated 2 I/O) and 6 outputs (2 dedicated 4 I/O)

Each of the outputs of the PAL16L8 is buffered by a tristate inverter, whose ENABLE input is controlled by its own product line. When the ENABLE line of the tristate inverter is

334 C H A P T E R 8 • Introduction to Programmable Logic Architectures

FIGURE 8.4

PAL16L8 I/O Section

I/O

HIGH, the inverter output is the same as it would normally be—a logic HIGH or LOW, determined by the state of the corresponding OR gate output.

When the ENABLE line is LOW, the inverter output is in the high-impedance state. The output acts as an open circuit, neither HIGH nor LOW; it is as though the output was completely disconnected from the circuit. The inverter is permanently enabled if all fuses on the ENABLE product line are blown, and permanently disabled if these fuses are all intact.

Published logic diagrams of PAL devices generally do not have fuses drawn on them. This allows us to draw fuses for any application. In practice, PLDs have become too complex to manually draw fuse maps for most applications.

Historically, PLD programming would begin with fuses drawn on a logic diagram, and each fuse would be selected and blown individually by someone operating a hardware device constructed for such a purpose.

Fuse assignment is now done with special software such asABEL, CUPL, or PALASM. These programs will take inputs such as Boolean equations, truth tables, or other forms and produce the simplest SOP solution to the particular problem. (MAX PLUS II is not configured to generate programming data for low-density PALs, although it can generate data for similar devices in the Altera Classic PLD series.)

The end result of such software is a JEDEC file, an industry-standard way of listing which fuses in the PLD should remain intact and which should be blown. The JEDEC file is stored on disk as an ASCII text file. Most PLD programmers will accept the JEDEC file and use it as a template for blowing fuses in the target device.

Fuse locations, called cells, are specified by two numbers: the product line first cell number, shown along the left side of the diagram, and the input line number, shown along the top. The address of any particular fuse is the sum of its product line first cell number and its input line number. The fuses on the PAL16L8 device are numbered from 0000 to 2047 ( 2016 31).

Figure 8.5 shows an example of a JEDEC file for a PAL16L8 application. The file starts with an ASCII “Start Text” character (^B). Next is some information required by the PAL programmer about the type of device (PAL16L8), number of fuses (2048), and so forth. The fuse information starts with the line L0000, which is the first product line. The 1s and 0s which follow show the programmed state of each cell in each product line; a 1 is a blown fuse and a 0 is an intact fuse. In other words, each 0 in the JEDEC file represents an X in the same position on the PAL logic diagram.

The product terms for first sum-of-products output are set by the states of fuses 0000 to 0255 (eight product lines). In the file shown, all fuses are blown in the first product

8.2 • PAL Fuse Matrix and Combinational Outputs

335

FIGURE 8.5

Sample JEDEC File

line, the second product line shows three intact fuses, and so forth. Since all fuses are intact in the last three lines, they need not be shown in the JEDEC file.

Whenever some unprogrammed product lines are omitted from the fuse map, the last fuse line shown ends with an asterisk (*). The next line with programmed fuses is indicated by a new fuse number. For example, the second group of fuses (0256 to 0511) in Figure 8.5 begins after the line marked L0256 in the JEDEC file. The remaining fuse lines are similarly indicated.

The JEDEC file in Figure 8.5 ends with a hexadecimal checksum (C8DCF), an errorchecking code derived from the programming data, and an ASCII “End Text” code (^C).

336 C H A P T E R 8 • Introduction to Programmable Logic Architectures

FIGURE 8.6

4-to-1 Multiplexer Circuits

In order to examine the general principle of fuse programming, let us develop the programmed logic diagram for a common combinational circuit: a 4-to-1 multiplexer. (After developing the fuse maps for several examples, we will not refer to this technique again.)

This circuit, shown in Figure 8.6a, directs one of four input logic signals, D0 to D3, to output Y, depending on the state of two select inputs S0 and S1. The circuit works on the enable/inhibit principle; each AND gate is enabled by a different combination of S1 S0. The binary state of the select inputs is the same as the decimal subscript of the selected data input. For instance, S1 S0 10 selects data input D2; the AND gate corresponding to D2 is enabled and the other three ANDs are inhibited.

The logic equation for output Y is given by:

Y D0 S1 S0 D1 S1 S0 D2 S1 S0 D3 S1 S0

Since the outputs of the PAL16L8 are active LOW, as illustrated in Figure 8.6b, we should rewrite the equation as follows:

Y D0 S1 S0 D1 S1 S0 D2 S1 S0 D3 S1 S0

The D inputs must be complemented to reverse the effect of the active-LOW output. The output is enabled when the EN input is HIGH. Figure 8.7 shows the PAL16L8A logic diagram with fuses for the multiplexer application.

8.3 PAL Outputs With Programmable Polarity

The multiplexer application developed in the previous section uses a PAL device whose output is always fixed at the active-LOW polarity. This fixed polarity is suitable for most applications, but Boolean functions that would normally have active-HIGH outputs must be implemented in DeMorgan equivalent form, which is not always very straightforward.

Some applications require both active-HIGH and active-LOW outputs. In such cases, it is useful to have a device whose output polarity is fuse programmable.

Figure 8.8 shows the logic diagram of a PAL20P8 PAL device. This device is the same as a PAL16L8, except that there are four more dedicated inputs, and the polarity of each output is programmable. The Exclusive OR gate on each output is programmed to act as either an inverter or a buffer. When its associated fuse is intact, the XOR input is grounded and passes the output of its related SOP network in true form. When combined with the output inverter, this produces an active-LOW output. When the polarity fuse is blown, the fused XOR input floats to the HIGH state, inverting the SOP output; the output pin becomes active HIGH.

8.3 • PAL Outputs With Programmable Polarity

337

FIGURE 8.7

Programmed Logic Diagram for a 4-to-1 Multiplexer

The polarity fuses are given numbers higher than those of the main fuse array. In this case, the product line fuses are numbered 0000 to 2559 and the output polarity fuses are numbered 2560 to 2567.

Figure 8.9 illustrates the selection of output polarity. Two Boolean functions, F1 and F2, are programmed into the fuse array, with outputs at pins (17) and (15), respectively. The equations are:

F1 A B A B

F2 A B A B

338 C H A P T E R 8 • Introduction to Programmable Logic Architectures

FIGURE 8.8

PAL20P8 Logic Diagram

We could, if we chose, rewrite F2 to show the output as active LOW:

F2 A B A B

The portion of the PAL20P8 logic diagram shown in Figure 8.9 represents the fuses required to program F1 and F2. Pins (14) and (16) supply inputs A and B to the matrix. The ENABLE lines of the tristate output buffers float HIGH, since all fuses are blown on the corresponding product lines, thus permanently enabling the output buffers.

The fuses numbered 2565 and 2567 select the polarity at pins (15) and (17). Fuse 2565 is blown. The fused input to the corresponding XOR gate floats HIGH, thus making the gate into an inverter. Combined with the tristate buffer, this makes pin (17) active HIGH.

Fuse 2567 is intact. This grounds the input to the corresponding XOR gate, making the gate into a noninverting buffer. Combined with the tristate output buffer, this makes pin (15) active LOW.

8.3 • PAL Outputs With Programmable Polarity

339

FIGURE 8.9

PAL Outputs With Programmable Polarity

EXAMPLE 8.1

Show how a PAL20P8 device can be used to implement the following logic functions by

 

drawing fuses on the device’s logic diagram.

 

NOT:

F1 A

 

AND:

F2 BC

 

OR:

F3 D E

 

NAND:

F4

FG

 

NOR:

F5

H J

 

XOR:

F6

K L K L K L

 

XNOR:

F7

M N M N M N

How would the implementation of these logic functions differ if only active-LOW outputs were available, as in a PAL16L8?

SOLUTION The PAL20P8 has 14 dedicated inputs, 2 dedicated outputs, and 6 lines that can be used as inputs or outputs. Our functions need 13 input variables and 7 output variables. We will use six I/O pins (pins (16) through (21)) and one dedicated output (pin (15)) for the output variables.