Professional Documents
Culture Documents
Ch#01 - Programmable Logic Devices
Ch#01 - Programmable Logic Devices
College of Engineering
Department of Electrical Engineering
Digital Electronics
CS308
Lecturer
Assist. Prof. Dr. Abdul-Basset A. Al-Hussein
1
Simple Programmable Logic Devices (SPLDs)
➢ Two major PLDs types are available: PAL and GAL, PAL are stands for programmable
array logic and GAL stands for generic array logic. Generally a PAL is one-time
programmable (OTP), and a GAL is a type of PAL that is reprogrammable.
➢ The basic structure of both PALs and GALs is a programmable AND array and a fixed
OR array, which is a basic sum-of-products (SOP) architecture
The PAL: A simple PAL structure is shown in Fig.1-1, for two inputs variables and one
output. Each programmable link which is a fuse and called a cell.
For example, the sum-of-products expression below can be represented in Fig.1-2.
Fig.1.1 Basic AND/OR structure of a PAL Fig.1.2 PAL implementation of a SOP expression
Assist. Prof. Dr. Abdul-Basset A. Al-Hussein Electrical Engineering Department/ University of Basrah 6
Example 1-1: Show how a PAL is programmed for the following 3-variable logic function:
The Macrocell
➢ Figure 1-10 shows the simplified diagram of a typical macrocell.
➢ As shown from Fig.1-10, five AND gates feed products terms from the PIA into the product term selection
matrix. The product term from the bottom AND gate can be fed back inverted into the programmable array
as a shared expander for use by other macrocells. The parallel expander inputs allow borrowing of unused
products terms from other macrocells to expand an SOP expression. The product term selection matrix is
an array of programmable connections that is used to connect selected outputs from the AND array and from
the expander inputs to the OR gate.
Assist. Prof. Dr. Abdul-Basset A. Al-Hussein Electrical Engineering Department/ University of Basrah 13
Shared Expanders
A complemented product term that can be used to increase the number of product terms in a SOP expression is
available from each macrocell in a LAB. Figure 1-11 shows how a shared expander term from another macrocell
can be used to create additional product terms.
Fig.1-11 Example of how a shared expander can be used in a macrocell to increase the number of product term.
Parallel Expanders
➢ Another way to increase the number of product terms for a macrocell is by using parallel expanders in which
additional product terms are ORed with the terms generated by a macrocell instead of being combined in the
AND array, as in the shared expander.
➢ A given macrocell can borrow unused terms from neighboring macrocells. See example in Fig.1-13.
Assist. Prof. Dr. Abdul-Basset A. Al-Hussein Electrical Engineering Department/ University of Basrah 18
Fig.1-16 Two types of logic
function generation in CPLDs.
Macrocell Modes
• Figure 1-18 shows the multiplexer common symbol.
• Figure 1-19 shows a complete macrocell including the flip-flop (register).
• The XOR gate provides for complementing the SOP function from OR gate to produce a function in POS form.
• MUX 1 provides for selection of either the XOR output or an input from the I/O.
• MUX 2 can be programmed to select either the global clock or a clock signal based on a product term.
• MUX 3 can be programmed to select either a HIGH (Vcc) or a product term enable for the flip-flop.
• MUX 4 can select the global clear or a product-term clear.
• MUX 5 is used to bypass the flip-flop and connect the combinational logic output to the I/O or to connect the
registered output to the I/O.
• The flip-flop can be programmed as a D, T, or J-K flip-flop.
Figure 1-20 Generation of an SOP logic function, combinational mode data path (red color).
Electrical Engineering Department/ University of Basrah 22
The registered Mode
Figure 1-21 shows a macrocell when is programmed for the registered mode with the SOP combinational logic
Output providing the data input to the register and clocked by the global clock, the elements in the data path are
Shown in red color.
Assist. Prof. Dr. Abdul-Basset A. Al-Hussein Electrical Engineering Department/ University of Basrah 23
• Basically, the FPGA differs in architecture, dose not use PAL/GAL types arrays, and has much greater densities
than CPLDs.
• The three basic elements in an FPGA are the configurable logic block (CLB), the interconnections, and the I/O
blocks as shown in Fig. 1-22.
• FPGAs are reprogrammable and use SRAM or antifuse process technology for the programmable links.
• Densities can range from hundreds of logic modules to hundreds of thousands of logic modules in packages with
up to over 1000 pins.
• DC supply voltages are typically 1.8 V to 5 V, depending on the specific device.
• A logic module in an FPGA logic block can be configured for combinational logic, registered logic, or a
combination of both.
• A flip-flop is part of the associated logic and is used for registered logic.
• Figure 1-24 shows a block diagram of a typical LUT-based logic module.
• An LUT is a type of memory that is programmable and used to generate SOP combinational logic functions.
• The LUT does the same job as the PAL does.
The organization of an LUT consists of number of memory cells equal to , where n is the number of input
Variables
Example 1-2: Show a basic 3-variable LUT programmed to produce the following SOP functions:
Assist. Prof. Dr. Abdul-Basset A. Al-Hussein Electrical Engineering Department/ University of Basrah 28
Operating Modes of a Logic Module
A logic module (LM) can be programmed for the following modes of operation:
▪ Normal mode
▪ Extended LUT mode
▪ Arithmetic mode
▪ Shared arithmetic mode
The normal mode is used primarily for generating combinational logic functions. Figure 1-26 shows some
examples of four LUT configurations in a logic module in the normal mode.
Figure 1-27 shows an expansion to a 7-variable function of the extended LUT mode.
Fig. 1-26 Examples of possible LUT configurations in a logic module (LM) in the normal mode.
Electrical Engineering Department/ University of Basrah 30
Fig. 1-27 Expansion of a LM to produce a 7-variable SOP function in the extended LUT mode.
Electrical Engineering Department/ University of Basrah 31
Example 1-3: A logic module is configured in the extended LUT mode, as shown in Fig. 1-28. for the specific LUT
outputs shown determine the final SOP output.
Solution: The SOP output expression is as follows:
Fig. 1-41 Predefined programs for a 2-input AND gate and a 2-input OR gate.
Electrical Engineering Department/ University of Basrah 35
Assist. Prof. Dr. Abdul-Basset A. Al-Hussein Electrical Engineering Department/ University of Basrah 36
Electrical Engineering Department/ University of Basrah 37
Assist. Prof. Dr. Abdul-Basset A. Al-Hussein Electrical Engineering Department/ University of Basrah 40
Example 1-6: Write a VHDL code for a decimal to BCD encoder.
Assist. Prof. Dr. Abdul-Basset A. Al-Hussein Electrical Engineering Department/ University of Basrah 41