Chapter 9: TOOLS

## 9-7: PLA and ROM Generation

### Introduction to PLAs

PLA generation is a process by which a set of input signals combines, through a logical sum of products, to form a set of output signals. For example, there may be two outputs: f and g, which are defined as follows:

 f = (a and b and (not c)) or ((not b) and (not a)) g = (a and c) or ((not a) and (not c))

This is a logical sum (or) of products (and), and the input terms may be negated (not). PLA generators require this information in the form of two personality tables: an AND table and an OR table. The AND table is as wide as there are inputs (3 in this case), and the OR table is as wide as there are outputs (2 in this case). The height of the tables is determined by the number of "product terms," which are the number of intermediate results required to define the logic (4 in this case). The AND table for the above equations is:

 a b c 1 1 0 a and b and (not c) 0 0 X (not b) and (not a) 1 X 1 (a and c) 0 X 0 (not a) and (not c)

Notice that there is a "1" where the input term is in a positive form, a "0" where the input term is in a negated form, and an "X" where the input term does not apply. The OR table for the above equations then combines the four product terms into the two output terms as follows:

 f g 1 0 f: a and b and (not c) 1 0 f: (not b) and (not a) 0 1 g: (a and c) 0 1 g: (not a) and (not c)

Electric's PLA generator tool consists of two different generators: an nMOS generator and a CMOS generator. Both use personality tables to specify which taps in the programming array are set. Both produce a hierarchical array specification made up of AND tables, OR tables, drivers, and all necessary power and ground wires.

### The nMOS PLA Generator

The nMOS generator produces a circuit in the "nmos" technology. The PLA is generated with the Make nMOS PLA subcommand of the PLA Generator command of the Tools menu. You will be prompted for the file name that describes the PLA.

Below is a sample file which defines the above logic as an nMOS PLA (this file can be found in the PLA-ROM subdirectory of the examples directory). Note that comments can be inserted after a semicolon. The number of inputs, outputs, and product terms must be provided so that the array of values between the "begin" and "end" can be properly parsed. The other parameters are optional. These include the power and ground widths (default is 4 lambda); whether to use butting-contacts or buried contacts (default is to use butting contacts); whether the outputs are on the same side as the inputs (default is to place on the opposite side); what constraints will be placed on the arcs in the PLA (default is nonrigid fixed-angle); and a name for the newly created PLA cell (default is "nmosXXX" where "XXX" is the PLA size).

```set inputs = 3                  ; sum of input and output is
set outputs = 2                 ;   number of columns
set pterms = 4                  ; 4 product terms (number of rows)
set vddwidth = 6                ; 6 lambda-wide supply rails
set groundwidth = 6
set buttingcontact = off        ; use buried contacts instead
set samesideoutput = on         ; outputs on same side as inputs
set flexible = on               ; use nonrigid arcs
set fixedangle = on             ; use fixed-angle arcs
set name = Sample               ; name to use for top-level cell
begin ;  Input     Output
;   1  2  3     1  2
1  1  0     1  0    ; product term 1
0  0  X     1  0    ; product term 2
1  X  1     0  1    ; product term 3
0  X  0     0  1    ; product term 4
end
```

### The CMOS PLA Generator

The CMOS PLA generator is somewhat more flexible than the nMOS version because it reads a library of support cells and uses them to produce the array. This means that it can handle any technology (although the only library that comes with Electric is for the MOSIS CMOS technology). For those who wish to construct their own library in another technology, note that it must contain the cells "decoder_inv1", "io-inv-4", "nmos_one", "pmos_one" and "pullups". Look at the library "pla_mocmos" (in the lib directory) for more information.

The CMOS PLA generator is run with the Make MOSIS CMOS PLA subcommand of the PLA Generator command of the Tools menu. You are then prompted for two files: the AND table file and the OR table file. These files are much simpler in format than the nMOS PLA input file. They have only two numbers on the first line to define the size of the array, and the values of the array on subsequent lines. Both the AND file and the OR file are similar. Example files can be found in the PLA-ROM subdirectory of the examples directory. Here is the AND file for the above logic:

```    4    3
1    1    0
0    0    X
1    X    1
0    X    0
```

### The ROM Generator

The ROM generator reads a single personality table and builds a ROM. Since the generator is written in Java, you must have Java installed in Electric in order for this to run.
 The first line of the ROM personality table lists the degree of folding. For example, a 256-word x 10-bit ROM with a folding degree of 4 will be implemented as a 64 x 40 array with 4:1 column multiplexers to return 10 bits of data while occupying more of a square form factor. The number of words and degree of folding should be powers of 2. The remaining lines of the file list the contents of each word. The parser is pretty picky. There should be a carriage return after the list word, but no other blank lines in the file.

For an example of a ROM personality table, see the file rom.txt in the PLA-ROM subdirectory of the examples directory.