Topic 12 of 13
ROM & Programmable Logic
ROM as a lookup table, then PLA and PAL: configurable AND and OR arrays.
← → move between slides · F full screen · M slide list
Before we start
Why this matters
How did a 1980s arcade machine know exactly which pixel-art villain to throw at you next, with zero software as we'd recognise it today?
It was hard-wired straight into a ROM chip — a lookup table baked into silicon that will never, ever change its mind. This chapter shows you that a ROM is basically a truth table you can buy off a shelf, and how PLAs and PALs let you “program” the wiring yourself instead of begging a chip factory for a custom favour.
Outline
Topics in this chapter
Select a topic to jump to the slide that explains it.
Concept 1 of 4
ROM organisation and logic
A 2n × m ROM has n address lines feeding a decoder, and the decoder’s word lines feed OR gates that form the m output bits. A 32 × 8 ROM has 5 inputs and 8 outputs. Reading applies an address, decodes it, selects one word and outputs its bits.
Because the decoder generates every minterm, a ROM implements any combinational function of its address bits. The inputs are the address, and the stored bits are the truth table. A full adder (3 inputs, 2 outputs) fits in an 8 × 2 ROM.
Concept 2 of 4
Types of ROM
| Type | Programming |
|---|---|
| Mask ROM | Fixed at manufacture |
| PROM | Once by the user |
| EPROM | Erased with ultraviolet light, then reprogrammed |
| EEPROM | Erased and programmed electrically |
| Flash | Electrical, erased in blocks |
All are non-volatile.
Concept 3 of 4
PLA and PAL
A PLA has a programmable AND array that forms product terms and a programmable OR array that combines them, so it implements sum-of-products directly with only the terms needed. A PAL has a programmable AND array and a fixed (or constrained) OR array: cheaper and faster, less flexible.
| Device | AND array | OR array |
|---|---|---|
| ROM | Fixed (full decoder) | Programmable |
| PLA | Programmable | Programmable |
| PAL | Programmable | Fixed |
A PLA's size is given as its number of inputs, product terms, and outputs — a typical PLA has 16 inputs, 48 product terms, and 8 outputs. Each input needs a connection to both its true and complemented form in the AND array, so the fuse (or switch) count is higher than a plain product-term count suggests.
Concept 3 of 4
PLA and PAL (cont.)
ROM fuses = 2ⁿ × m
(n inputs, k product terms, m outputs)
Concept 4 of 4
Design flow
- Define the functions.
- Simplify the Boolean expressions (don’t-cares help).
- Identify product terms, sharing them across outputs.
- Map terms to the device.
- Program and verify.
Modern programmable logic includes CPLDs and FPGAs, which scale the same idea to thousands of configurable blocks.
Truth tables
Truth tables (1 of 2)
ROM contents: full adder in an 8 × 2 ROM
| A | B | C | Sum | Cout |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 |
PLA program table: F1 = AB + A′C, F2 = AC + BC
| Term | A | B | C | F1 | F2 |
|---|---|---|---|---|---|
| P1 = AB | 1 | 1 | – | 1 | – |
| P2 = A′C | 0 | – | 1 | 1 | – |
| P3 = AC | 1 | – | 1 | – | 1 |
| P4 = BC | – | 1 | 1 | – | 1 |
1 means the true input, 0 the complement, – means not connected.
Truth tables
Truth tables (2 of 2)
ROM, PLA and PAL arrays
| Device | AND array | OR array |
|---|---|---|
| ROM | Fixed | Programmable |
| PLA | Programmable | Programmable |
| PAL | Programmable | Fixed |
Interactive
Demo: ROM and PLA
Worked example 1 of 3
Worked example 1
Show the solution
- Product terms: P1 = AB, P2 = A′C, P3 = AC, P4 = BC.
- AND array: connect A,B to P1; A′,C to P2; A,C to P3; B,C to P4.
- OR array: F1 = P1 + P2 and F2 = P3 + P4.
Worked example 2 of 3
Worked example 2
Show the solution
Worked example 3 of 3
Worked example 3
Show the solution
- 3 inputs need 23 = 8 words, one per input combination.
- Tabulate the squares: 0,1,4,9,16,25,36,49 — the largest, 49, needs 6 bits (B5…B0), so a first guess is an 8 × 6 ROM.
- Two output columns turn out to be trivial: B1 is 0 for every row, and B0 always equals A0. Neither needs a stored bit — B1 can be tied to 0 and B0 wired straight from A0.
- Only B5, B4, B3 and B2 actually need ROM storage, so the design shrinks to an 8 × 4 ROM plus two wires.
Practice
Practice (1 of 2)
Try each one on paper first, then check your answer.
Show the answer
Show the answer
Show the answer
Practice
Practice (2 of 2)
Try each one on paper first, then check your answer.
Show the answer
Show the answer
Build a decoder plus OR gates that behaves like a small ROM, and Save it as a component.
Gate ForgeA free circuit simulator — place and wire gates, generate truth tables and timing diagrams, and work through 90+ guided problems.Check yourself
Quiz
Summary
Summary
- A ROM is a lookup table: decoder plus OR array.
- Mask, PROM, EPROM, EEPROM and Flash differ in how they are programmed and erased.
- PLA: AND and OR both programmable. PAL: AND programmable, OR fixed.
- Share product terms to save resources.
- CPLDs and FPGAs are the modern versions.