Salta al contenuto
Note per Studenti Programmable Logic Devices - ROM, PLA, PAL and FPGA Report

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

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 2k×n2^k\times n). 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 kk address inputs and nn data outputs holds 2k2^k words of nn bits (written 2k×n2^k\times n).

Example. With k=10k=10 and n=8n=8: 210=10242^{10}=1024 words of 88 bits (ROM 1024×81024\times8, i.e. 10241024 bytes).

Structure. A kk-to-2k2^k decoder turns the address into a one-hot signal (one active line per word); its outputs feed nn OR gates with 2k2^k inputs and programmable connections: if the connection between a word line and the OR of bit jj exists, bit jj of that word is 1, otherwise 0. For a 32×832\times8 ROM (5 address bits, 8 data bits), if at address 11 the ORs of bits 7,4,1,07,4,1,0 are connected, the word read is 10010011.

A ROM is a physical truth table: it implements any combinational function of kk variables with nn outputs. Example, the 8×28\times2 ROM of a full adder, address XYZXYZ, word CSCS:

address XYZXYZ 000 001 010 011 100 101 110 111
content CSCS 00 01 01 10 01 10 10 11

(the content is the number of 1s at the input written in binary: SS is the parity, CC 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. F1=AB‾+ACF_1=A\overline B+AC, F2=AC+BC‾F_2=AC+B\overline C. Product terms: P1=AB‾P_1=A\overline B, P2=ACP_2=AC, P3=BC‾P_3=B\overline C; P2P_2 is shared:

term AA BB CC F1F_1 F2F_2
P1=AB‾P_1=A\overline B 1 0 - x
P2=ACP_2=AC 1 - 1 x x
P3=BC‾P_3=B\overline C - 1 0 x

(Inputs: 1 = direct variable, 0 = complemented, - = not connected. Outputs: x = term enters the OR.) 3 ANDs are needed. Truth table (ABC=000ABC=000 to 111111): F1=0,0,0,0,1,1,0,1F_1=0,0,0,0,1,1,0,1; F2=0,0,1,0,0,1,1,1F_2=0,0,1,0,0,1,1,1.

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 F1,F2F_1,F_2 a PAL needs 44 ANDs (ACAC must be duplicated), a PLA 33.

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): 2k×12^k\times1 memories that, through a multiplexer, implement the truth table of a function of kk variables. The configuration bits set the data inputs of the MUX.

Example. A 2-input LUT with c00,c01,c10,c11=0,1,1,0c_{00},c_{01},c_{10},c_{11}=0,1,1,0: for (a,b)=(1,0)(a,b)=(1,0) it reads c10=1c_{10}=1, i.e. a⊕b=1a\oplus b=1.

  • 2-input LUT: 4 configuration bits, any of the 222=162^{2^2}=16 Boolean functions of a,ba,b.
  • 3-input LUT: two 2-input LUTs plus a 2-to-1 MUX (select cc), 223=2562^{2^3}=256 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 2k×n2^k\times n: non-volatile, read-only; decoder k→2kk\to2^k plus nn programmable ORs. A physical truth table, combinational. k=10,n=8k=10,n=8: 1024×81024\times8 (1024 bytes). Full adder: 8×28\times2 ROM, content CS=00,01,01,10,01,10,10,11CS=00,01,01,10,01,10,10,11. 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. F1=AB‾+ACF_1=A\overline B+AC, F2=AC+BC‾F_2=AC+B\overline C: 3 ANDs (ACAC 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: 2k×12^k\times1 memory behind a MUX; 2-input LUT = 16 functions (bits 0,1,1,00,1,1,0 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.

Teoria collegata