ECE4101-PLD Lecturers 2019
ECE4101-PLD Lecturers 2019
PROGRAMMABLE
LOGIC DEVICES (PLD)
1
Suplementary reading Books
• Digital Logic Circuit Analysis and Deign
– Authors:
– Victor R. Nelson
– H. Troy Nagle
– J. David Irwin
– Bill D. Carroll
• Chapter 5
2
Why Programmable Logic?
• Facts:
– It is most economical to produce an IC in large
volumes
– Many designs required only small volumes of ICs
• Need an IC that can be:
– Produced in large volumes
– Handle many designs required in small volumes
• A programmable logic part can be:
– made in large volumes
– programmed to implement large numbers of different
low-volume designs
3
Programmable Logic - Additional Advantages
• Many programmable logic devices are field-
programmable, i. e., can be programmed outside of
the manufacturing environment
• Most programmable logic devices are erasable and
reprogrammable.
– Allows “updating” a device or correction of errors
– Allows reuse the device for a different design - the ultimate
in re-usability!
– Ideal for course laboratories
• Programmable logic devices can be used to
prototype design that will be implemented for sale in
regular ICs.
– Complete Intel Pentium designs were actually prototype with
specialized systems based on large numbers of VLSI
programmable devices! 4
Programming Technologies
• Programming technologies are used to:
– Control connections
– Build lookup tables
– Control transistor switching
• The technologies
– Control connections
• Mask programming
• Fuse
• Antifuse
• Single-bit storage element
5
Technology Characteristics
• The technologies (continued)
– Build lookup tables
• Storage elements (as in a memory)
– Transistor Switching Control
• Stored charge on a floating transistor gate
– Erasable
– Electrically erasable
– Flash (as in Flash Memory)
• Storage elements (as in a memory)
6
Technology Characteristics
• Permanent - Cannot be erased and reprogrammed
• Mask programming
• Fuse
• Antifuse
• Reprogrammable
– Volatile - Programming lost if chip power lost
• Single-bit storage element
– Non-Volatile
• Erasable
• Electrically erasable
• Flash (as in Flash Memory)
– Build lookup tables
• Storage elements (as in a memory) 7
PLD
An IC that contains large numbers of gates, flip-flops,
etc. that can be configured by the user to perform
different functions is called a Programmable Logic
Device (PLD).
The internal logic gates and/or connections of PLDs can
be changed/configured by a programming process.
One of the simplest programming technologies is to use
fuses. In the original state of the device, all the fuses are
intact.
Programming the device involves blowing those fuses
along the paths that must be removed in order to obtain
the particular configuration of the desired logic function.
8
PLD
• Problems of using standard ICs in logic design:
9
PLD
• Advantages of reducing the no. of ICs using PLD:
10
PLD
Types of Programmable Logic Devices
• SPLDs (Simple Programmable Logic Devices)
– ROM (Read-Only Memory)
– PLA (Programmable Logic Array)
– PAL (Programmable Array Logic)
– GAL (Generic Array Logic)
• CPLD (Complex Programmable Logic Device)
• FPGA (Field-Programmable Gate Array)
11
PLD
• The first three varieties are quite similar to
each other:
– They all have an input connection matrix, which
connects the inputs of the device to an array of
AND-gates.
– They all have an output connection matrix, which
connect the outputs of the AND-gates to the inputs
of OR-gates which drive the outputs of the device.
13
General structure of PLDs.
14
Tristate Buffer
A tristate buffer can output 3 different
values:
Logic 1 (high)
Logic 0 (low)
High-Impedance
control
input output
18
OR - PLD Notation
19
AND - PLD Notation
20
21
ROM, PAL and PLA Configurations
Fixed Programmable
Inputs Programmable Outputs
AND array
(decoder) Connections OR array
23
Read-Only Memory (ROM)
Fixed Programmable
Inputs Programmable Outputs
AND array
(decoder) Connections OR array
24
PROM Notation
25
ROM as a Memory
• Read Only Memories (ROM) or Programmable Read
Only Memories (PROM) have:
– N input lines,
– M output lines, and
– 2N decoded minterms.
• Can be viewed as a memory with the inputs as
addresses of data (output values),
– hence ROM or PROM names!
27
Using a PROM for logic design
F3 F2 F1 F0
29
ROM
• Decoder
Produces minterms
• ORs 0
1
A‘B’C’D’
A ‘B’C’D
F1
Produce SOP’s 2
3
A‘B’CD’
A‘B’CD
A S3 4 A‘BC’D’
5 A‘BC’D
S2
B 4:16
6 A‘BCD’
7 A‘ BCD
S1 dec
C 8 A B’C’D’ F2
9 A B’C’D
S0 10 A B’CD’
D
11 A B’CD
12 A B C’D’
13 A B C’D
14 A B C D’ F3
15 AB C D
Enb
30
Example
a 0
1
3-to-8 2
b 3
decoder 4
5
c 6
7
f g h
32
Example: 32x8 ROM
A ROM has an internal decoder and n OR gates
• 32 words of 8 bits each
– 32*8=256 programmable internal connections
– 5 inputs decoded into 32 distinct outputs by 5x32
decoder
–Each of 8 OR gates have 32 inputs
33
Example: 32x8 ROM
programmable
intersection:
crosspoint switch
•Two conditions
– close: two lines
are connected
– open: two lines
are disconnected
•Implemented by
fuse
– normally connects
the two points
– opened or “blown”
by applying a
high-voltage pulse
A7(I4,I3,I2,I1,I0)
=Σ(0,2,3,…,29)
34
Example: PROM
𝑸 𝟑= 𝑨𝑩+ 𝑪 𝑫 , 𝑸𝟐= 𝑨𝑩 𝑪
𝑸 𝟏= 𝑨𝑩 𝑪 𝑫+ 𝑨 𝑩 𝑪 𝑫 ,
𝑸 𝟎= 𝑨+𝑩 𝑫+𝑪 𝑫
35
ROM as Memory
• Read Example: For input (A2,A1,A0) = 011, output is
(F0,F1,F2,F3 ) = 0010.
• What are functions F3, F2 , F1 and F0 in terms of (A2, A1, A0)?
37
PLA
Programmable Programmable Programmable Programmable
Inputs Outputs
Connections AND array Connections OR array
38
PLA
The AND and OR gates inside the PLA are initially
fabricated with the links (fuses) among them.
The specific Boolean functions are implemented in sum of
products form by opening appropriate links and leaving the
desired connections.
A block diagram of the PLA is shown in the figure. It
consists of n inputs, m outputs, and k product terms.
39
PLA
The product terms constitute a group of k AND gates each of
2n inputs.
Links are inserted between all n inputs and their complement
values to each of the AND gates.
Links are also provided between the outputs of the AND gates
and the inputs of the OR gates.
Since PLA has m-outputs, the number of OR gates is m.
The output of each OR gate goes to an XOR gate, where the
other input has two sets of links, one connected to logic 0 and
other to logic 1. It allows the output function to be generated
either in the true form or in the complement form.
The output is inverted when the XOR input is connected to 1
(since X ⊕ 1 = X/). The output does not change when the XOR
input is connected to 0 (since X ⊕ 0 = X).
40
PLA
Thus, the total number of programmable links is 2n x k + k x
m + 2m.
The size of the PLA is specified by the number of inputs (n),
the number of product terms (k), and the number of outputs
(m), (the number of sum terms is equal to the number of
outputs).
Advantages of PLA
42
PLA Logic Implementation
Implement: F1(A, B, C) = Σ (0, 1, 2, 4); F2(A, B, C) = Σ (0,
5, 6, 7)
43
PLA Logic
Implementation Unprogrammed device
• Alternative representation
for
high fan-in structures
• Short-hand notation so we
don't
have to draw all the wires!
• X at junction indicates a
connection
A B C D Programmed device
AB+AB CD+CD
44
Example: PLA Logic Implementation
PLA as ROM: A B C Bit stored in memory
Multiple functions of A, B, C
ABC
F1 = A B C
A
F2 = A + B + C B
C
F3 = A B C
A
F4 = A + B + C B
C
F5 = A B C
ABC
F6 = A B C ABC
ABC
ABC
ABC
ABC
ABC
Address F1 F2 F3 F4 F5 F6
45
Example: PLA Logic Implementation
47
PLAs: NOR-NOR Implementation
PLA structures
Programmable Logic Array structures provide a logical and
compact method of implementing multiple SOP (Sum of
Products) or POS expressions
48
PLAs: NOR-NOR Implementation
Pseudo-NMOS
full nMOSlogic array
• replace pMOSarray with single pull up
transistor
• Ratioed Logic
–requires proper txsize ratios•
• Advantages
–less load capacitance on input signals
•faster switching–
-fewer transistors
•higher circuit density
• Disadvantage
–pull up is always on
•significant static power dissipation Fig. nMOS generic
–VOL> 0 pseudo-nMOS logic
gatepseudo
49
PLAs: NOR-NOR Implementation
Pseudo-NMOS
50
PLAs: NOR-NOR Implementation
Truth
Table:
X1 X2 Z
Xi = 0 turns transistor OFF (transistor = open circuit) 0 0 1
Xi = 1 turns transistor ON (transistor shorts Z to ground/0)
+V pulls Z up to 1 if not shorted to ground 0 1 0
1 0 0
1 1 0
51
PLAs: NOR-NOR Implementation
𝐹 0=¿
52
PLAs: NOR-NOR Implementation
53
PLAs: NOR-NOR Implementation
products sum
Equivalent
AND-OR form
54
PLA Logic Implementation
Example: NOR-NOR PLA
De-Morgan’s Law:
𝐴 . 𝐵= 𝐴+ 𝐵
𝐴+ 𝐵= 𝐴 𝐵
55
PLA Logic Implementation
Example: Full Adder using NOR-NOR PLA
56
PLA Logic Implementation
Example: Full Adder using nMOS NOR_NOR PLA
𝑉 𝑠𝑠
𝑉 𝑠𝑠
57
PLAs: NOR-NOR Implementation
PLA structures
Programmable Logic Array structures provide a logical and
compact method of implementing multiple SOP (Sum of
Products) or POS expressions
𝑉 𝑑𝑑
𝑉 𝑑𝑑
𝑉 𝑑𝑑
𝑉 𝑑𝑑
59
PLAs (Contd)
𝑉 𝑑𝑑
60
PLAs (Contd)
PLA structure
61
PLAs (Contd)
Design a PLA circuit using
Pseduo-NMOS NOR-NOR to
realize the following sum
of product functions:
62
Programmable Array
Logic (PAL)
63
(PAL)
The steps for PAL design and implementation are given
below:
64
(PAL)
Advantages of PALs
* Ease of design
* Performance
* Reliability
* Cost Savings
Characteristics of PALs
COMBINATIONAL:
* Number of inputs
* Number of outputs
* Number of product terms per
output
* Speed
* Power consumption
* Reprogrammable ?
REGISTERED:
* + Number of Registers
65
(PAL)
66
PALs and PLAs
• What is difference between Programmable Array Logic (PAL)
and
Programmable Logic Array (PLA)?
• PAL concept — implemented by Monolithic Memories
- AND array is programmable, OR array is fixed at
fabrication
67
Programmable Array Logic (PAL)
• Disadvantage
– ROM guaranteed to implement any M functions of N
inputs. PAL may have too few inputs to the OR gates.
• Advantages
– For given internal complexity, a PAL can have larger
N and M
– Some PALs have outputs that can be complemented,
adding POS functions
68
PALs and PLAs
• Of the two organizations the PLA is the most
flexible
– One PLA can implement a huge range of logic functions
– BUT many pins; large package, higher cost
• PALs are more restricted / you trade number of OR
terms vs number of outputs
– Many device variations needed
– Each device is cheaper than a PLA
69
A simple input and output PAL device.
inputs
1st output
section
4th output
section
70
PAL Logic
Implementation(Example)
W = ABC + A’B’C
X = AB + ABC
71
PAL Logic
Implementation(Example)
W = ABC + CD
X = ABC + ACD + ACD + BCD
Y = ACD + ACD + ABD
72
Example: PAL
𝑸 𝟑= 𝑨𝑩+ 𝑪 𝑫 , 𝑸𝟐= 𝑨𝑩 𝑪
𝑸 𝟏= 𝑨𝑩 𝑪 𝑫+ 𝑨 𝑩 𝑪 𝑫 ,
𝑸 𝟎= 𝑨+𝑩 𝑫+𝑪 𝑫
73
PLA,PAL and ROM Logic
Implementation
Design a PLA, PAL and ROM at a gate level to realize the following sum of
product functions:
X(A,B,C)=A.B+A.B.C+A.B.C
Y(A,B,C)=A.B+A.B.C
Z(A,B,C)=A+B
74
PLA,PAL and ROM Logic
Implementation
Design a PLA, PAL and ROM at a gate level to realize the following sum of product functions:
X(A,B,C)=A.B+A.B.C+A.B.C
Y(A,B,C)=A.B+A.B.C
Z(A,B,C)=A+B
ROM Implementation:
75
PLA,PAL and ROM Logic
Implementation
Design a PLA, PAL and ROM at a gate level to realize the following sum of product functions:
X(A,B,C)=A.B+A.B.C+A.B.C
Y(A,B,C)=A.B+A.B.C
Z(A,B,C)=A+B
PAL Implementation:
76
PLA,PAL and ROM Logic
Implementation
Design a PLA, PAL and ROM at a gate level to realize the following sum of product functions:
X(A,B,C)=A.B+A.B.C+A.B.C
Y(A,B,C)=A.B+A.B.C
Z(A,B,C)=A+B
PLA Implementation:
77
PLA,PAL and ROM Logic
Implementation
Example: The internal connection diagram for a PLA is given
below.
(a) Write the equations realized by the PLA.
(b) Specify the truth table for a ROM which would realize the
same function
78
PLA,PAL and ROM Logic
Implementation
Solution:
(a)
X = A'BD + C'D + AB' + AB'C'D'
Y = A'BD + BCD + AB'
Z = A'BD + BCD + ABC + AB'C'D'
79
PLA,PAL and ROM Logic
Implementation
Solution:(b) ROM table is given below. Realization by ROM does not require
any minimization. All states are simply mapped as defined in the state table. Size
of the ROM would be 16x4 bits as shown in the block diagram below.
80
81
82
PLA Extra circuitry: Macrocell
Select Enable
f1
Flip-flop
D Q
Clock
To AND plane
For additional flexibility, extra circuitry is added at the output of each OR gate.
This is also referred to macrocell.
83
PLA Extra circuitry : Macrocell
2-to-1 multiplexer selects an output from the OR gate output or the flip-flop
output. Tri-state buffers are placed between multiplexer and the PAL output.
Multiplexer’s output is fed back to the AND plane in PAL, which allows the
multiplexer signal to be used internally in the PAL. This facilitates the
implementation of circuits that have multiple stages (levels or logic gates).
84
Example: FSM Implementation using
Microcell
85
GAL
OR
-When tri-state buffer
is in high-Z mode,
OR and FF are
disconnected and
pin can be used
for input To AND
94
Sequential Programmable Devices
Three major types of PLD
Sequential (or simple) programmable logic
device (SPLD)
• field-programmable logic sequencer (FPLS)
Complex programmable logic device (CPLD)
Field programmable gate array (FPGA)
Sequential programmable devices
combinational PLD + flip-flops
perform a variety of sequential-circuit
functions
Many commercial vendor-specific variants and
internal logic of these devices is too complex to be
shown here
95
Sequential(or Simple) Programmable logic
Devices
97
FPGA
98
FPGA Classification
FPGA
types
99
FPGA
architecture
The FPGA consists of 3 main structures:
1. Programmable logic structure,
2. Programmable routing structure, and
3. Programmable Input/Output (I/O).
100
FPGA
architecture
1. Programmable logic structure
The programmable logic structure FPGA consists of a 2-dimensional
array of configurable logic blocks (CLBs).
101
FPGA
architecture
1. Programmable logic structure
Each CLB can be configured (programmed) to implement any
Boolean function of its input variables. Typically CLBs have
between 4-6 input variables. Functions of larger number of
variables are implemented using more than one CLB.
In addition, each CLB typically contains 1 or 2 FFs to allow
implementation of sequential logic.
Large designs are partitioned and mapped to a number of
CLBs with each CLB configured (programmed) to perform a
particular function.
These CLBs are then connected together to fully implement
the target design. Connecting the CLBs is done using the
FPGA programmable routing structure.
102
FPGA
architecture
2. Programmable routing structure
To allow for flexible interconnection of CLBs, FPGAs have 3
programmable routing resources:
1. Vertical and horizontal routing channels which consist of
different length wires that can be connected together if needed.
These channel run vertically and horizontally between columns
and rows of CLBs as shown in the Figure.
2. Connection boxes, which are a set of programmable links
that can connect input and output pins of the CLBs to wires of
the vertical or the horizontal routing channels.
3. Switch boxes, located at the intersection of the vertical and
horizontal channels. These are a set of programmable links that
can connect wire segments in the horizontal and vertical
channels.
103
FPGA
architecture
2. Programmable routing structure
104
FPGA
architecture
3. Programmable Input/Output (I/O)
These are mainly buffers that can be configured either as
input buffers, output buffers or input/output buffers.
They allow the pins of the FPGA chip to function either as
input pins, output pins or input/output pins.
Programable I/Os
105
FPGA
architecture
106
FPGA
architecture
FPGA architecture
107
FPGA
architecture
108
What does a logic cell do?
• The logic cell architecture varies between different device
families.
• Each logic cell combines a few binary inputs (typically
between 3 and 10) to one or two outputs according to a
Boolean logic function specified in the user program .
• In most families, the user also has the option of registering
the combinatorial output of the cell, so that clocked logic
can be easily implemented.
• Cell's combinatorial logic may be physically implemented
as a small look-up table memory (LUT) or as a set of
multiplexers and gates.
• LUT devices tend to be a bit more flexible and provide
more inputs per cell than multiplexer cells at the expense of
propagation delay.
109
what does 'Field Programmable'
mean?
• Field Programmable means that the FPGA's function is
defined by a user's program rather than by the manufacturer
of the device.
• A typical integrated circuit performs a particular function
defined at the time of manufacture. In contrast, the FPGA's
function is defined by a program written by someone other
than the device manufacturer.
• Depending on the particular device, the program is either
'burned' in permanently or semi-permanently as part of a
board assembly process, or is loaded from an external
memory each time the device is powered up.
• This user programmability gives the user access to complex
integrated designs without the high engineering costs
associated with application specific integrated circuits.
110
How are FPGA programs
created?
• Individually defining the many switch connections and cell
logic functions would be a daunting task.
• This task is handled by special software. The software
translates a user's schematic diagrams or textual hardware
description language code then places and routes the
translated design.
• Most of the software packages have hooks to allow the user
to influence implementation, placement and routing to
obtain better performance and utilization of the device.
• Libraries of more complex function macros (eg. adders)
further simplify the design process by providing common
circuits that are already optimized for speed or area.
111
FPGA
FPGA applications:-
i. DSP
ii. Software-defined radio
iii. Aerospace
iv. Defense system
v. ASIC Prototyping
vi. Medical Imaging
vii. Computer vision
viii.Speech Recognition
ix. Cryptography
x. Bioinformatic
xi. And others.
112
CPLD
Chips containing PLDs are limited to modest sizes,
typically supporting number of input and output more
than 32. To accommodate circuits that require more
input and outputs, either multiple PLAs or PALs can
be used or a more sophisticated type of chip, called a
complex programmable logic device (CLPD).
CLPD is made up of multiple circuit blocks on a single
chip, with internal wiring to connect the circuit
blocks.
block
I/O
PAL-like PAL-like
block
block block
I/O
Interconnection Wires
block
I/O
PAL-like PAL-like
block
block block
I/O
114
Section of CPLD blocks
PAL-like Block
PAL-like Block
D Q
D Q
115
CPLD
CPLD: a collection of PLDs to be connected to
each other through a programmable switch
matrix
input/output blocks provide connections to IC pins
each I/O pin is driven by a three-state buffer and
can be programmed to act as input or output
switch matrix receives inputs from I/O block and
directs it to individual macrocells
selected outputs from macrocells are sent to the
outputs as needed
each PLD typically contains from 8 to 16 macrocells
the macrocells within each PLD are usually fully
connected. If a macrocell has unused product terms
they can be used by other nearby macrocells.
116
CPLD
CLPD uses quad flat pack (QFP) type of package.
QFP package has pins on all four sides and the pins
extend outward from the package with a downward-
curving shape. Moreover, QFP pins are much thinner
and hence, they support a larger number of pins
when compared to the PLCC packing.
119
CPLD
121
Look up Table (LUT)
A k input LUT can implement any Boolean function of k variables. The
inputs are used as addresses that can retrieve the 2k by 1-bit memory that
stores the truth table of the Boolean function.
Since the size of the memory increases with the number of inputs, k, in
order to optimize this mapping and reduce the size of the memory there are
a variety of algorithms that map a Boolean network, from a given
equation, into a circuit of k-input LUT. These algorithms minimize either
the total number of LUTs or the number of levels of LUTs in the final
circuit. Minimizing the total number of LUTs reduces the CLB
requirements while minimizing the levels of LUTs improves the delay.
122
x1 x2 f1
Logic blocks are often
0 0 1
Look up Table (LUT) 0 1 0
f1= x1 x2 + x1 x2
1 0 0
Function to be implemented 1 1 1
0/1 1
0/1 0
0/1 0
0/1 1
123
Look up Table (LUT)
abc def ghl jk l m
def
ghi
x y 4 input y
x
LUT
5 input
z LUT
z
124
FPGA with example
• What is an FPGA
Field Programmable Gate Array
• Programmable Interconnect
- there are programmable interconnect switches that connect the LUTs
X X X X X
X X X X X
• Configuration
- We start with a Gate Level Schematic of our design (from synthesis)
- The FPGA LUTs are configured to implement Gates
X X X X X
X X X X X
• Configuration
- The interconnect switches are then programmed to implement the net connections
B X X X X X Out
C INV X OR X LUT
X X X X X
• Configuration
- The LUT and Interconnect configuration is volative (i.e., it goes away when power is
removed)
- Since the programming is done by the user after fabrication, we call it "Field
Programmable" A INV X AND X LUT
B X X X X X Out
C INV X OR X LUT
X X X X X
- They put a DFF next to a 4-Input LUT to form a "Configurable Logic Block" (CLB)
CLB X CLB
X X X
CLB X CLB
FPGA CLB with Look Up Table
Look up table
FF, registers, clock storage elements
MUX
Configured FPGA
136