Lesson 23 +40 XP

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.

DeviceAND arrayOR arrayWhat the AND array produces
PROMfixed (a full decoder)programmableall 2n minterms
PLAprogrammableprogrammableonly the product terms needed, shared by all outputs
PALprogrammablefixeda 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.

SolvedExample 1 · Inside a 32 × 8 ROM

Describe the internal structure of a 32 × 8 ROM. How many programmable connections does it have?

  1. 32 = 25 words: 5 address lines and a 5-to-32 decoder.
  2. 8 bits per word: 8 OR gates, each with 32 possible inputs.
  3. Programmable connections: 32 × 8 = 256, one per stored bit.
Answer5 address inputs, a 5 × 32 decoder, 8 OR gates, 256 programmable links (256 bits)

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.

SolvedExample 2 · A squaring circuit in ROM (Mano)

Design a circuit that outputs the square of a 3-bit number A2A1A0 using a ROM, with the smallest ROM possible.

A2A1A0DecimalSquareB5B4B3B2B1B0
00000000000
00111000001
01024000100
01139001001
100416010000
101525011001
110636100100
111749110001
  1. The output needs 6 bits (49 < 64), so a naive ROM is 8 × 6.
  2. Column B0 equals A0 (odd squares are odd), and column B1 is always 0. Neither needs the ROM.
  3. Only B5 B4 B3 B2 are stored.
Answeran 8 × 4 ROM (32 bits), with B1 = 0 and B0 = A0 wired directly

8 × 4 ROM storing the squares8 × 4 ROM storing the squares

Types of ROM

TypeProgrammed byErasable?
Mask ROMthe manufacturer, in the last fabrication maskno; economical only in large volume
PROMthe user, once, by blowing fuses with high-current pulsesno (one-time programmable)
EPROMthe user, electricallyyes, by ultraviolet light through a quartz window (whole chip)
EEPROMthe user, electricallyyes, electrically, byte by byte
Flashthe user, electricallyyes, 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.

SolvedExample 3 · PLA for two functions (Mano)

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.

  1. 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'.
  1. Choose F1' and F2: they share AB and AC, so only 4 distinct product terms are needed (AB, AC, BC, A'B'C').
  2. Programming table (T = 1 complements the output):
ProductA B CF1F2
1: AB1 1 -11
2: AC1 - 111
3: BC- 1 11-
4: A'B'C'0 0 0-1
T1 (complement)0 (true)
Answer4 product terms; F1 = (AB + AC + BC)', F2 = AB + AC + A'B'C'

PLA programmed for F1 and F2PLA programmed for F1 and F2

SolvedExample 4 · Size of a PLA vs a ROM

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?

  1. AND array: each product term can connect to 16 true and 16 complemented inputs: 2 × 16 × 48 = 1536.
  2. OR array: 48 × 8 = 384. Output XOR links: 8.
  3. Total: 1536 + 384 + 8 = 1928.
  4. ROM: 216 × 8 = 524{,}288 bits.
Answer1928 links for the PLA versus 524,288 bits of ROM (the PLA can only do it if 48 product terms suffice)

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.

SolvedExample 5 · PAL with 3 product terms per output (Mano)

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).

  1. Simplify: W = ABC' + A'B'CD'; X = A + BCD; Y = A'B + CD + B'D'.
  2. Z = ABC' + A'B'CD' + AC'D' + A'B'C'D needs 4 terms, one too many.
  3. Its first two terms are exactly W, so feed W back: Z = W + AC'D' + A'B'C'D (3 terms).
OutputProduct terms
WABC', A'B'CD', (unused)
XA, BCD, (unused)
YA'B, CD, B'D'
ZW, AC'D', A'B'C'D
Answeras tabulated; Z uses the fed-back output W

PAL programmed for W, X, Y and ZPAL programmed for W, X, Y and Z

4. Comparison and Beyond

PROMPLAPAL
Programmable arraysOR onlyAND and ORAND only
Product termsall 2n mintermschosen, sharedchosen, not shared
Simplification needednoyes (minimise jointly)yes (per output)
Size for many inputsgrows as 2nsmallsmall
Speed / costfast, but wasteful for sparse functionsslower (two programmable arrays)fast, cheap
Best forlookup tables, code convertersmany outputs sharing termsgeneral 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:

VERILOG
// 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
endmodule

B1 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:

OUTPUT
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: 0
💡 Tip

Key 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.
🎯 END-TERM EXAM PREP

📝 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)