Programmable Logic Devices - ROM, PLA, PAL and FPGA
In questa pagina 5
Ordinary gates implement fixed functions. Programmable logic devices (PLD) are integrated circuits whose logic structures are modifiable, configured by the manufacturer or the user to perform different functions. Configuration changes the hardware and realises that logic function in the device: it must not be confused with software programming of a microcontroller, where the hardware does not change.
How a device is programmed
Irreversible (once only):
- fuse / anti-fuse: connections between logic elements are removed (fuse) or created (anti-fuse) selectively by applying high voltages;
- mask programming: connections are made by the manufacturer in the last fabrication step.
Reversible (reconfigurable many times):
- switches connected to volatile memory (typically SRAM): the programming is lost without power (Memories - ROM, RAM, SRAM and DRAMA memory is a set of cells organised in words, with control circuitry. It is classified as read-only (ROM) or read/write, random access (RAM), serial (SAM) or hybrid (Flash), volatile (SRAM, DRAM) or non-volatile. A RAM 2^k x n has k address bits (independent of n), n data bits, read/write and chip select. SRAM uses a bistable latch cell, is fast and needs no refresh; DRAM stores charge on a capacitor, is denser and needs refresh. Chips are organised as a row/column matrix with coincident selection and tri-state outputs, and combined in arrays for more words or more bits per word.Memories - ROM, RAM, SRAM and DRAM →);
- switches driven by MOSFETs with programmable threshold voltage, floating gate: generally non-volatile.
Compact symbol. A high fan-in gate is drawn with a single line; an x at a crossing means that line is connected to the gate.
ROM (Read Only Memory)
Definition (ROM ). In a ROM data are stored permanently, even without power (non-volatile). It can only be read: give the address, read the word. A ROM with address inputs and data outputs holds words of bits (written ).
Example. With and : words of bits (ROM , i.e. bytes).
Structure. A -to- decoder turns the address into a one-hot signal (one active line per word); its outputs feed OR gates with inputs and programmable connections: if the connection between a word line and the OR of bit exists, bit of that word is 1, otherwise 0. For a ROM (5 address bits, 8 data bits), if at address the ORs of bits are connected, the word read is 10010011.
A ROM is a physical truth table: it implements any combinational function of variables with outputs. Example, the ROM of a full adder, address , word :
| address | 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 |
|---|---|---|---|---|---|---|---|---|
| content | 00 | 01 | 01 | 10 | 01 | 10 | 10 | 11 |
(the content is the number of 1s at the input written in binary: is the parity, the majority). A ROM is a combinational memory: it has no state.
ROM types:
- mask ROM: connections made by the manufacturer;
- PROM (fuse/anti-fuse): user-programmable once;
- EPROM: floating gate, erasable with ultraviolet light and reprogrammable;
- EEPROM (E²PROM): floating gate, electrically erasable and reprogrammable;
- Flash: an evolution of EEPROM.
The choice depends on volumes, number of reprogrammings, performance and cost.
PLA (Programmable Logic Array)
Definition (PLA). A PLA is similar to a ROM, but the decoder is replaced by an array of programmable AND gates, each generating a product term (possibly with fewer literals than input variables, i.e. in simplified form) from the inputs, direct or complemented. The product terms are then connected programmably to OR gates. Both arrays (AND and OR) are programmable. Unlike the ROM, the PLA does not generate all minterms, only a programmable subset, and product terms can be shared between outputs. The OR outputs may go through a programmable XOR, giving the output direct or complemented.
To get a small PLA, minimise the number of product terms by sharing them between outputs; the number of literals per term matters little, since all direct and complemented variables are available.
Example. , . Product terms: , , ; is shared:
| term | |||||
|---|---|---|---|---|---|
| 1 | 0 | - | x | ||
| 1 | - | 1 | x | x | |
| - | 1 | 0 | x |
(Inputs: 1 = direct variable, 0 = complemented, - = not connected. Outputs: x = term enters the OR.) 3 ANDs are needed. Truth table ( to ): ; .
To obtain a smaller PLA it can pay to implement the complemented function (the output XOR restores it) or to use non-prime implicants shared among outputs.
PAL (Programmable Array Logic)
Definition (PAL). A PAL has a programmable AND array and a fixed OR array. It is less flexible than a PLA but simpler, cheaper and faster. In a PAL product terms cannot be shared between ORs: every output has its own ANDs. Functions are therefore optimised at two levels one output at a time, whereas for PLAs outputs are optimised together.
Example. For the same a PAL needs ANDs ( must be duplicated), a PLA .
| AND | OR | sharing of products | |
|---|---|---|---|
| ROM | fixed (decoder) | programmable | all minterms available |
| PLA | programmable | programmable | yes |
| PAL | programmable | fixed | no |
FPGA (Field Programmable Gate Array)
FPGAs are, after Flash memories, the most widespread PLDs. They have in common:
- programmable logic blocks (combinational and sequential);
- programmable interconnections (routing);
- programmable I/O pins.
They may also include specialised blocks (memories, arithmetic blocks, microprocessors). Information on the implemented circuit is held in the configuration memory, volatile (SRAM) or non-volatile (Flash, fuse/anti-fuse). Programming an FPGA means setting the configuration bits of the logic blocks, routing and pins. A VHDL description, once synthesised, produces the configuration file (VHDL - Entity, Architecture, Types and Description LevelsVHDL is a hardware description language, not a programming language: its statements are concurrent and describe blocks of circuit, used to document, simulate and synthesise. A block has an entity (name and in/out ports) and at least one architecture (what is inside) written in structural style with components and port map, dataflow style with Boolean equations, or behavioral style. Types include std_logic with values 0, 1, X, Z, U and -, std_logic_vector, bit, boolean and integer; signal is used for internal connections and constant for fixed values.VHDL - Entity, Architecture, Types and Description Levels →).
Look-up table
Definition (look-up table). In many families the logic block contains LUTs (Look-Up Tables): memories that, through a multiplexer, implement the truth table of a function of variables. The configuration bits set the data inputs of the MUX.
Example. A 2-input LUT with : for it reads , i.e. .
- 2-input LUT: 4 configuration bits, any of the Boolean functions of .
- 3-input LUT: two 2-input LUTs plus a 2-to-1 MUX (select ), functions.
An FPGA contains thousands or millions of LUTs plus flip-flops, multiplexers and arithmetic blocks. With further configurable multiplexers the same cell can give a combinational output, a registered output (Moore: depends only on the state in the FF) or an output that also depends on the inputs (Mealy).
Versione ripasso
- PLD: configurable hardware (not software programming). Irreversible: fuse/anti-fuse, mask. Reversible: SRAM-controlled switches (volatile), floating gate (usually non-volatile).
- ROM : non-volatile, read-only; decoder plus programmable ORs. A physical truth table, combinational. : (1024 bytes). Full adder: ROM, content . Types: mask ROM, PROM, EPROM (UV), EEPROM, Flash.
- PLA: programmable AND and OR arrays, only needed product terms, shared between outputs, optional XOR on outputs. Minimise product terms. , : 3 ANDs ( shared).
- PAL: programmable AND, fixed OR, no sharing; cheaper and faster; same example needs 4 ANDs.
- Comparison: ROM fixed AND, programmable OR, all minterms; PLA both programmable, sharing yes; PAL programmable AND, fixed OR, no sharing.
- FPGA: logic blocks, routing, I/O; configuration memory volatile (SRAM) or not (Flash, anti-fuse). LUT: memory behind a MUX; 2-input LUT = 16 functions (bits give XOR), 3-input = two LUT2 + MUX = 256 functions. Cell with FF gives Moore (registered) or Mealy outputs.
- Mistakes: ROM vs PLA (ROM always has all minterms); saying PAL shares products; configuration vs programming; thinking ROMs have state; forgetting a volatile configuration must be reloaded at power-up.