Loading lessons...
Programmable Logic Devices: ROM, PLA & PAL
Programmable Logic Devices: ROM, PLA & PAL
Building every function from individual gates wastes board space and design time. A programmable logic device (PLD) is an IC with a regular array of AND gates feeding OR gates, where the connections are chosen (programmed) by the user.
Since every Boolean function has a sum-of-products form, an AND array followed by an OR array can implement any combinational function. The three classic PLDs differ only in which array is programmable.
| Device | AND array | OR array | What the AND array produces |
|---|---|---|---|
| PROM | fixed (a full decoder) | programmable | all 2n minterms |
| PLA | programmable | programmable | only the product terms needed, shared by all outputs |
| PAL | programmable | fixed | a few product terms per output, not shared |
Array notation. A PLD has too many wires to draw every gate input. Each AND or OR gate is drawn with a single input line; an × where a line crosses that input means a programmed connection (an intact fuse). A dot means a fixed, permanent connection.
1. Read-Only Memory (ROM)
A ROM of size 2k × n stores 2k words of n bits. It has k address inputs and n data outputs. Internally it is a k-to-2k decoder (the fixed AND array, one output per minterm) followed by n OR gates (the programmable OR array). Programming a 1 into bit j of word i connects decoder output i to OR gate j.
Describe the internal structure of a 32 × 8 ROM. How many programmable connections does it have?
- 32 = 25 words: 5 address lines and a 5-to-32 decoder.
- 8 bits per word: 8 OR gates, each with 32 possible inputs.
- Programmable connections: 32 × 8 = 256, one per stored bit.
Combinational circuits with a ROM
A ROM implements a truth table directly: the inputs are the address and the outputs are the stored word. No simplification is needed; the K-map step disappears.
Design a circuit that outputs the square of a 3-bit number A2A1A0 using a ROM, with the smallest ROM possible.
| A2A1A0 | Decimal | Square | B5B4B3B2B1B0 |
|---|---|---|---|
| 000 | 0 | 0 | 000000 |
| 001 | 1 | 1 | 000001 |
| 010 | 2 | 4 | 000100 |
| 011 | 3 | 9 | 001001 |
| 100 | 4 | 16 | 010000 |
| 101 | 5 | 25 | 011001 |
| 110 | 6 | 36 | 100100 |
| 111 | 7 | 49 | 110001 |
- The output needs 6 bits (49 < 64), so a naive ROM is 8 × 6.
- Column B0 equals A0 (odd squares are odd), and column B1 is always 0. Neither needs the ROM.
- Only B5 B4 B3 B2 are stored.
8 × 4 ROM storing the squares
Types of ROM
| Type | Programmed by | Erasable? |
|---|---|---|
| Mask ROM | the manufacturer, in the last fabrication mask | no; economical only in large volume |
| PROM | the user, once, by blowing fuses with high-current pulses | no (one-time programmable) |
| EPROM | the user, electrically | yes, by ultraviolet light through a quartz window (whole chip) |
| EEPROM | the user, electrically | yes, electrically, byte by byte |
| Flash | the user, electrically | yes, electrically, a block at a time; dense and cheap |
2. Programmable Logic Array (PLA)
A ROM generates every minterm even when most are not needed: a 16-input function needs a 216-word ROM. A PLA generates only the product terms the functions need, and any product term can feed any output. Each output also has an XOR gate with a programmable input, so the output can be complemented: this lets the designer implement either F or F', whichever needs fewer product terms.
A PLA is specified by a PLA programming table: one row per product term, with 1 (true literal), 0 (complemented literal) or - (not used) for each input, and 1 or - for each output.
Implement F1(A, B, C) = ∑ m(0, 1, 2, 4) and F2(A, B, C) = ∑ m(0, 5, 6, 7) with a PLA using as few product terms as possible.
- Simplify both functions and both complements:
- F1 = A'B' + A'C' + B'C'; F1' = AB + AC + BC.
- F2 = AB + AC + A'B'C'; F2' = A'C + A'B + AB'C'.
- Choose F1' and F2: they share AB and AC, so only 4 distinct product terms are needed (AB, AC, BC, A'B'C').
- Programming table (T = 1 complements the output):
| Product | A B C | F1 | F2 |
|---|---|---|---|
| 1: AB | 1 1 - | 1 | 1 |
| 2: AC | 1 - 1 | 1 | 1 |
| 3: BC | - 1 1 | 1 | - |
| 4: A'B'C' | 0 0 0 | - | 1 |
| T | 1 (complement) | 0 (true) |
PLA programmed for F1 and F2
A PLA has 16 inputs, 48 product terms and 8 outputs (like the 82S100). (a) How many programmable links does it have? (b) How large would a ROM for the same inputs and outputs be?
- AND array: each product term can connect to 16 true and 16 complemented inputs: 2 × 16 × 48 = 1536.
- OR array: 48 × 8 = 384. Output XOR links: 8.
- Total: 1536 + 384 + 8 = 1928.
- ROM: 216 × 8 = 524{,}288 bits.
3. Programmable Array Logic (PAL)
A PAL has a programmable AND array but a fixed OR array: each output OR gate is permanently wired to its own small group of product terms (typically 2 to 8). It is cheaper and faster than a PLA and easier to program, but product terms cannot be shared between outputs, and each output is limited to the number of terms in its group. Many PALs feed outputs back into the AND array so that a function needing more terms can use another output as a sub-function.
Implement the following with a PAL having 4 inputs and 4 outputs, each output OR gate fixed to 3 product terms: W = ∑ m(2, 12, 13), X = ∑ m(7, 8, 9, 10, 11, 12, 13, 14, 15), Y = ∑ m(0, 2, 3, 4, 5, 6, 7, 8, 10, 11, 15), Z = ∑ m(1, 2, 8, 12, 13).
- Simplify: W = ABC' + A'B'CD'; X = A + BCD; Y = A'B + CD + B'D'.
- Z = ABC' + A'B'CD' + AC'D' + A'B'C'D needs 4 terms, one too many.
- Its first two terms are exactly W, so feed W back: Z = W + AC'D' + A'B'C'D (3 terms).
| Output | Product terms |
|---|---|
| W | ABC', A'B'CD', (unused) |
| X | A, BCD, (unused) |
| Y | A'B, CD, B'D' |
| Z | W, AC'D', A'B'C'D |
PAL programmed for W, X, Y and Z
4. Comparison and Beyond
| PROM | PLA | PAL | |
|---|---|---|---|
| Programmable arrays | OR only | AND and OR | AND only |
| Product terms | all 2n minterms | chosen, shared | chosen, not shared |
| Simplification needed | no | yes (minimise jointly) | yes (per output) |
| Size for many inputs | grows as 2n | small | small |
| Speed / cost | fast, but wasteful for sparse functions | slower (two programmable arrays) | fast, cheap |
| Best for | lookup tables, code converters | many outputs sharing terms | general glue logic |
Larger devices extend the same ideas: a CPLD puts many PAL-like blocks on one chip with a programmable interconnect, and an FPGA uses thousands of small lookup tables (tiny ROMs) plus flip-flops. Both are programmed from an HDL description such as the Verilog in these lessons.
5. ROM and PLA in Verilog
A ROM is naturally written as a case lookup table; a PLA is a set of assign statements whose product terms are shared wires. The testbench prints the ROM and checks the PLA against the minterm lists:
// A ROM is a lookup table; a PLA / PAL is a set of shared sum-of-products equations
module square_rom (
input [2:0] a,
output reg [5:0] b
);
always @(*) begin
case (a) // one ROM word per address
3'd0: b = 6'd0;
3'd1: b = 6'd1;
3'd2: b = 6'd4;
3'd3: b = 6'd9;
3'd4: b = 6'd16;
3'd5: b = 6'd25;
3'd6: b = 6'd36;
3'd7: b = 6'd49;
endcase
end
endmodule
module pla (
input A, B, C,
output F1, F2
);
wire p1 = A & B, p2 = A & C, p3 = B & C, p4 = ~A & ~B & ~C; // AND array
assign F1 = ~(p1 | p2 | p3); // OR array, output complemented (XOR with 1)
assign F2 = p1 | p2 | p4; // OR array, true output
endmodule
module tb;
reg [2:0] a;
wire [5:0] b;
wire F1, F2;
reg [7:0] f1_spec = 8'b0001_0111; // bit m = 1 for the minterms of F1 = sum m(0, 1, 2, 4)
reg [7:0] f2_spec = 8'b1110_0001; // F2 = sum m(0, 5, 6, 7)
integer i, bad = 0;
square_rom rom (.a(a), .b(b));
pla p (.A(a[2]), .B(a[1]), .C(a[0]), .F1(F1), .F2(F2));
initial begin
$display("addr word B1 B0");
for (i = 0; i < 8; i = i + 1) begin
a = i;
#1 $display(" %b %b %b %b", a, b, b[1], b[0]);
if (F1 !== f1_spec[i] || F2 !== f2_spec[i])
bad = bad + 1;
end
$display("PLA rows that differ from the minterm lists: %0d", bad);
end
endmoduleB1 is always 0 and B0 always equals A0, which is why the ROM only needs four columns; the PLA agrees with both minterm lists on all 8 rows:
addr word B1 B0
000 000000 0 0
001 000001 0 1
010 000100 0 0
011 001001 0 1
100 010000 0 0
101 011001 0 1
110 100100 0 0
111 110001 0 1
PLA rows that differ from the minterm lists: 0Key points to remember
- ROM = fixed decoder (AND) + programmable OR; 2k × n ROM has k address lines, n outputs, 2k · n bits.
- PLA = programmable AND + programmable OR + output XOR; minimise F and F' jointly to share product terms.
- PAL = programmable AND + fixed OR; terms not shared; feedback helps when an output needs too many terms.
- PLA links: 2nk + km + m for n inputs, k products, m outputs.
📝 IPU End-Term Exam Corner (5-10 Marks)
- Q1. Implement F1 = ∑ m(0, 1, 2, 4) and F2 = ∑ m(0, 5, 6, 7) using a PLA. Give the PLA programming table. (10 Marks)
- Write: the K-maps of F1, F1', F2, F2'; the choice of F1' and F2; the 4-row table with T values; the array diagram.
- Q2. Design a combinational circuit using a ROM that accepts a 3-bit number and outputs its square. (5 Marks)
- Q3. Compare PROM, PLA and PAL. (5 Marks)
- Q4. Implement four given functions with a PAL having 3 product terms per output. (10 Marks)
- Q5. Explain the internal organisation of a 32 × 8 ROM. Distinguish PROM, EPROM and EEPROM. (5 Marks)